From 946bcc9b591d065cfbf2c22665d653c8acecb907 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Sun, 17 May 2026 09:44:11 +0100 Subject: [PATCH] Replace extern --- src/common/aliases/aliases.h | 2 +- src/common/assert/assert.h | 2 +- src/os/file/file.h | 19 +++++++++++-------- 3 files changed, 13 insertions(+), 10 deletions(-) diff --git a/src/common/aliases/aliases.h b/src/common/aliases/aliases.h index 93ca8de..b51b135 100644 --- a/src/common/aliases/aliases.h +++ b/src/common/aliases/aliases.h @@ -60,7 +60,7 @@ typedef intptr_t iptr; #ifdef WAPP_PLATFORM_CPP #define wapp_class_mem static -#define BEGIN_C_LINKAGE extern "C" { +#define BEGIN_C_LINKAGE wapp_extern "C" { #define END_C_LINKAGE } #endif // WAPP_PLATFORM_CPP diff --git a/src/common/assert/assert.h b/src/common/assert/assert.h index 445cf1d..e7ffb3c 100644 --- a/src/common/assert/assert.h +++ b/src/common/assert/assert.h @@ -13,7 +13,7 @@ BEGIN_C_LINKAGE #endif // !WAPP_PLATFORM_CPP -#define wapp_static_assert(EXPR, MSG) extern char ASSERTION_FAILED[EXPR ? 1 : -1] +#define wapp_static_assert(EXPR, MSG) wapp_extern char ASSERTION_FAILED[EXPR ? 1 : -1] #ifndef WAPP_NO_RUNTIME_ASSERT #define wapp_runtime_assert(EXPR, MSG) __wapp_runtime_assert(EXPR, MSG) diff --git a/src/os/file/file.h b/src/os/file/file.h index 5da9938..e2936cc 100644 --- a/src/os/file/file.h +++ b/src/os/file/file.h @@ -12,6 +12,9 @@ BEGIN_C_LINKAGE #endif // !WAPP_PLATFORM_CPP typedef struct WFile WFile; +// wapp_extern WFile *WF_STDIN; +// wapp_extern WFile *WF_STDOUT; +// wapp_extern WFile *WF_STDERR; typedef enum { WAPP_ACCESS_READ, // Equivalent to r @@ -47,14 +50,14 @@ i32 wapp_file_close(WFile *file); i32 wapp_file_rename(Str8RO *old_filepath, Str8RO *new_filepath); i32 wapp_file_remove(Str8RO *filepath); -extern WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode); -extern i64 _file_seek(WFile *file, i64 offset, FileSeekOrigin origin); -extern u64 _file_read(void *dst_buf, u64 byte_count, WFile *file, u64 file_length); -extern i64 _file_write(const void *src_buf, WFile *file, u64 byte_count); -extern i32 _file_flush(WFile *file); -extern i32 _file_close(WFile *file); -extern i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath); -extern i32 _file_remove(Str8RO *filepath); +wapp_extern WFile *_file_open(const Allocator *allocator, Str8RO *filepath, FileAccessMode mode); +wapp_extern i64 _file_seek(WFile *file, i64 offset, FileSeekOrigin origin); +wapp_extern u64 _file_read(void *dst_buf, u64 byte_count, WFile *file, u64 file_length); +wapp_extern i64 _file_write(const void *src_buf, WFile *file, u64 byte_count); +wapp_extern i32 _file_flush(WFile *file); +wapp_extern i32 _file_close(WFile *file); +wapp_extern i32 _file_rename(Str8RO *old_filepath, Str8RO *new_filepath); +wapp_extern i32 _file_remove(Str8RO *filepath); #ifdef WAPP_PLATFORM_CPP END_C_LINKAGE