From 98a802e3ebd550e780bf3655b27fa2711dff95d1 Mon Sep 17 00:00:00 2001 From: Abdelrahman Date: Mon, 5 May 2025 02:48:35 +0100 Subject: [PATCH] Remove C++ pseudo support --- codegen/datatypes.py | 7 +----- src/common/aliases/aliases.h | 25 ++++++++++++------- src/common/platform/platform.h | 25 +------------------ src/core/mem/arena/mem_arena.h | 8 ------ src/core/mem/arena/mem_arena_allocator.h | 8 ------ src/core/mem/utils/mem_utils.h | 8 ------ src/core/os/cpath/cpath.h | 8 ------ src/core/os/mem/mem_os.h | 8 ------ src/core/os/mem/mem_os_ops.h | 8 ------ src/core/os/mem/posix/mem_os_posix.h | 8 ------ src/core/os/mem/win/mem_os_win.h | 8 ------ src/core/os/shell/commander/commander.h | 8 ------ .../os/shell/commander/commander_output.h | 8 ------ src/core/os/shell/termcolour/termcolour.h | 8 ------ .../os/shell/termcolour/terminal_colours.h | 8 ------ src/primitives/array/array.h | 8 ------ src/primitives/dbl_list/dbl_list.h | 8 ------ src/primitives/mem_allocator/mem_allocator.h | 10 -------- src/primitives/strings/str8/str8.h | 8 ------ src/prng/xorshift/xorshift.c | 4 +-- src/prng/xorshift/xorshift.h | 8 ------ src/testing/tester/tester.h | 8 ------ src/uuid/uuid.h | 8 ------ tests/allocator/test_allocator.h | 8 ------ tests/arena/test_arena.h | 8 ------ tests/array/test_i32_array.h | 8 ------ tests/cpath/test_cpath.h | 8 ------ tests/shell_commander/test_shell_commander.h | 8 ------ tests/str8/test_str8.h | 8 ------ tests/str8/test_str8_list.h | 8 ------ 30 files changed, 20 insertions(+), 251 deletions(-) diff --git a/codegen/datatypes.py b/codegen/datatypes.py index deb0485..36cd2df 100644 --- a/codegen/datatypes.py +++ b/codegen/datatypes.py @@ -246,10 +246,7 @@ class CHeader(CFile): name_upper = self.name.upper() header_guard_name = f"{name_upper}_H" header_guard_open = f"#ifndef {header_guard_name}\n#define {header_guard_name}\n\n" - header_guard_close = f"#endif // !{header_guard_name}\n" - - c_linkage_open = "#ifdef WAPP_PLATFORM_CPP\nBEGIN_C_LINKAGE\n#endif // !WAPP_PLATFORM_CPP\n\n" - c_linkage_close = "\n#ifdef WAPP_PLATFORM_CPP\nEND_C_LINKAGE\n#endif // !WAPP_PLATFORM_CPP\n\n" + header_guard_close = f"\n#endif // !{header_guard_name}\n" includes = _get_includes_string(self.includes) @@ -277,12 +274,10 @@ class CHeader(CFile): super().__str__() + header_guard_open + includes + - c_linkage_open + macros + forward_declarations + types + funcs + - c_linkage_close + header_guard_close ) diff --git a/src/common/aliases/aliases.h b/src/common/aliases/aliases.h index 13aece7..3b3f029 100644 --- a/src/common/aliases/aliases.h +++ b/src/common/aliases/aliases.h @@ -4,9 +4,22 @@ #include "../platform/platform.h" #include -#define c8 uint8_t -#define c16 uint16_t -#define c32 uint32_t +#if WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C11_VERSION + #include + + #if WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C23_VERSION + #define c8 char8_t + #else + #define c8 uint8_t + #endif // !WAPP_PLATFORM_C23_VERSION + + #define c16 char16_t + #define c32 char32_t +#else + #define c8 uint8_t + #define c16 uint16_t + #define c32 uint32_t +#endif // !WAPP_PLATFORM_C11_VERSION #define u8 uint8_t #define u16 uint16_t @@ -29,10 +42,4 @@ #define internal static #define persistent static -#ifdef WAPP_PLATFORM_CPP -#define class_mem static -#define BEGIN_C_LINKAGE extern "C" { -#define END_C_LINKAGE } -#endif // WAPP_PLATFORM_CPP - #endif // !ALIASES_H diff --git a/src/common/platform/platform.h b/src/common/platform/platform.h index 099c781..3e50bc3 100644 --- a/src/common/platform/platform.h +++ b/src/common/platform/platform.h @@ -59,30 +59,7 @@ #endif #ifdef __cplusplus - #define WAPP_PLATFORM_CPP - #define WAPP_PLATFORM_CPP_VERSION __cplusplus - #define WAPP_PLATFORM_CPP98_VERSION 199711L - #define WAPP_PLATFORM_CPP11_VERSION 201103L - #define WAPP_PLATFORM_CPP14_VERSION 201402L - #define WAPP_PLATFORM_CPP17_VERSION 201703L - #define WAPP_PLATFORM_CPP20_VERSION 202002L - #define WAPP_PLATFORM_CPP23_VERSION 202302L - - #if WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP98_VERSION - #define WAPP_PLATFORM_CPP98 - #elif WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP11_VERSION - #define WAPP_PLATFORM_CPP11 - #elif WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP14_VERSION - #define WAPP_PLATFORM_CPP14 - #elif WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP17_VERSION - #define WAPP_PLATFORM_CPP17 - #elif WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP20_VERSION - #define WAPP_PLATFORM_CPP20 - #elif WAPP_PLATFORM_CPP_VERSION == WAPP_PLATFORM_CPP23_VERSION - #define WAPP_PLATFORM_CPP23 - #else - #error "Unrecognised C++ version" - #endif + #error "WAPP is a C only library" #else #define WAPP_PLATFORM_C diff --git a/src/core/mem/arena/mem_arena.h b/src/core/mem/arena/mem_arena.h index c659540..f3ae1ce 100644 --- a/src/core/mem/arena/mem_arena.h +++ b/src/core/mem/arena/mem_arena.h @@ -6,10 +6,6 @@ #include "../../os/mem/mem_os.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef struct arena Arena; #define wapp_mem_arena_init(arena_dptr, base_capacity) \ @@ -34,8 +30,4 @@ void *wapp_mem_arena_realloc_aligned(Arena *arena, void *ptr, u64 old_size, u64 void wapp_mem_arena_clear(Arena *arena); void wapp_mem_arena_destroy(Arena **arena); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_ARENA_H diff --git a/src/core/mem/arena/mem_arena_allocator.h b/src/core/mem/arena/mem_arena_allocator.h index 4bf1e35..f6ebd4f 100644 --- a/src/core/mem/arena/mem_arena_allocator.h +++ b/src/core/mem/arena/mem_arena_allocator.h @@ -7,10 +7,6 @@ #include "../../os/mem/mem_os.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #define wapp_mem_arena_allocator_init(base_capacity) \ (wapp_mem_arena_allocator_init_custom(base_capacity, WAPP_MEM_ALLOC_RESERVE, false)) #define wapp_mem_arena_allocator_init_commit(base_capacity) \ @@ -35,8 +31,4 @@ Allocator wapp_mem_arena_allocator_init_custom(u64 base_capacity, MemAllocFlags void wapp_mem_arena_allocator_clear(Allocator *allocator); void wapp_mem_arena_allocator_destroy(Allocator *allocator); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_ARENA_ALLOCATOR_H diff --git a/src/core/mem/utils/mem_utils.h b/src/core/mem/utils/mem_utils.h index a17c688..5575fe4 100644 --- a/src/core/mem/utils/mem_utils.h +++ b/src/core/mem/utils/mem_utils.h @@ -4,14 +4,6 @@ #include "../../../common/aliases/aliases.h" #include "../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - void *wapp_mem_util_align_forward(void *ptr, u64 alignment); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_UTILS_H diff --git a/src/core/os/cpath/cpath.h b/src/core/os/cpath/cpath.h index 3e3b9a3..7f648b8 100644 --- a/src/core/os/cpath/cpath.h +++ b/src/core/os/cpath/cpath.h @@ -6,10 +6,6 @@ #include "../../../primitives/mem_allocator/mem_allocator.h" #include "../../../primitives/strings/str8/str8.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #ifdef WAPP_PLATFORM_POSIX #define PATH_SEP '/' #elif defined(WAPP_PLATFORM_WINDOWS) @@ -31,8 +27,4 @@ enum { u32 wapp_cpath_join_path(Str8 *dst, const Str8List *parts); Str8 *dirup(const Allocator *allocator, Str8RO *path, u64 levels); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !CPATH_H diff --git a/src/core/os/mem/mem_os.h b/src/core/os/mem/mem_os.h index 7e23457..522e53b 100644 --- a/src/core/os/mem/mem_os.h +++ b/src/core/os/mem/mem_os.h @@ -4,10 +4,6 @@ #include "../../../common/aliases/aliases.h" #include "../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #include "mem_os_ops.h" #if defined(WAPP_PLATFORM_WINDOWS) @@ -25,8 +21,4 @@ void wapp_mem_util_free(void *ptr, u64 size); external void *mem_util_allocate(void *addr, u64 size, MemAccess access, MemAllocFlags flags, MemInitType type); external void mem_util_free(void *ptr, u64 size); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_OS_H diff --git a/src/core/os/mem/mem_os_ops.h b/src/core/os/mem/mem_os_ops.h index 13e8f35..8916915 100644 --- a/src/core/os/mem/mem_os_ops.h +++ b/src/core/os/mem/mem_os_ops.h @@ -3,10 +3,6 @@ #include "../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef enum mem_access { WAPP_MEM_ACCESS_NONE, WAPP_MEM_ACCESS_READ_ONLY, @@ -21,8 +17,4 @@ typedef enum mem_init_type { WAPP_MEM_INIT_INITIALISED, } MemInitType; -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_OS_OPS_H diff --git a/src/core/os/mem/posix/mem_os_posix.h b/src/core/os/mem/posix/mem_os_posix.h index 94dc32d..00bd1d5 100644 --- a/src/core/os/mem/posix/mem_os_posix.h +++ b/src/core/os/mem/posix/mem_os_posix.h @@ -3,10 +3,6 @@ #include "../../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #ifdef WAPP_PLATFORM_POSIX #include @@ -26,8 +22,4 @@ typedef enum mem_alloc_flags { #endif // !WAPP_PLATFORM_POSIX -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #endif // !MEM_OS_POSIX_H diff --git a/src/core/os/mem/win/mem_os_win.h b/src/core/os/mem/win/mem_os_win.h index 8562406..2d2cf5e 100644 --- a/src/core/os/mem/win/mem_os_win.h +++ b/src/core/os/mem/win/mem_os_win.h @@ -3,10 +3,6 @@ #include "../../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #ifdef WAPP_PLATFORM_WINDOWS #define WIN32_LEAN_AND_MEAN @@ -20,8 +16,4 @@ typedef enum mem_alloc_flags { #endif // !WAPP_PLATFORM_WINDOWS -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #endif // !MEM_OS_WIN_H diff --git a/src/core/os/shell/commander/commander.h b/src/core/os/shell/commander/commander.h index 5a5e648..8cbaa78 100644 --- a/src/core/os/shell/commander/commander.h +++ b/src/core/os/shell/commander/commander.h @@ -9,18 +9,10 @@ #include #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #define CMD_NO_EXIT(ERR) ((CMDResult){.exited = false, .exit_code = EXIT_FAILURE, .error = ERR}) CMDResult wapp_shell_commander_execute(CMDOutHandling out_handling, Str8 *out_buf, const Str8List *cmd); external CMDError get_output_status(FILE *fp, i32 *status_out); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !COMMANDER_H diff --git a/src/core/os/shell/commander/commander_output.h b/src/core/os/shell/commander/commander_output.h index 4741290..e4cdfe2 100644 --- a/src/core/os/shell/commander/commander_output.h +++ b/src/core/os/shell/commander/commander_output.h @@ -5,10 +5,6 @@ #include "../../../../common/platform/platform.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef enum { SHELL_OUTPUT_DISCARD, SHELL_OUTPUT_PRINT, @@ -36,8 +32,4 @@ struct commander_result { #endif // !WAPP_PLATFORM_WINDOWS }; -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !COMMANDER_OUTPUT_H diff --git a/src/core/os/shell/termcolour/termcolour.h b/src/core/os/shell/termcolour/termcolour.h index cda7868..15f8856 100644 --- a/src/core/os/shell/termcolour/termcolour.h +++ b/src/core/os/shell/termcolour/termcolour.h @@ -6,17 +6,9 @@ #include "../../../../common/platform/platform.h" #include "../../../../primitives/strings/str8/str8.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - void wapp_shell_termcolour_print_text(Str8RO *text, TerminalColour colour); void wapp_shell_termcolour_clear_colour(void); external void print_coloured_text(Str8RO *text, TerminalColour colour); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TERM_COLOUR_H diff --git a/src/core/os/shell/termcolour/terminal_colours.h b/src/core/os/shell/termcolour/terminal_colours.h index 029b3e2..e404b94 100644 --- a/src/core/os/shell/termcolour/terminal_colours.h +++ b/src/core/os/shell/termcolour/terminal_colours.h @@ -3,10 +3,6 @@ #include "../../../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef enum { WAPP_TERM_COLOUR_FG_BLACK, WAPP_TERM_COLOUR_FG_RED, @@ -29,8 +25,4 @@ typedef enum { COUNT_TERM_COLOUR, } TerminalColour; -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TERMINAL_COLOURS_H diff --git a/src/primitives/array/array.h b/src/primitives/array/array.h index 70906b1..ce2b48f 100644 --- a/src/primitives/array/array.h +++ b/src/primitives/array/array.h @@ -12,10 +12,6 @@ #include "../../common/platform/platform.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #define wapp_str8_array(...) ((Str8Array){ \ .items = (Str8[wapp_misc_utils_u64_round_up_pow2(wapp_misc_utils_va_args_count(Str8, __VA_ARGS__) * 2)]){__VA_ARGS__}, \ .count = wapp_misc_utils_va_args_count(Str8, __VA_ARGS__), \ @@ -498,8 +494,4 @@ UptrArray *wapp_uptr_array_append_alloc(const Allocator *allocator, UptrArray *a UptrArray *wapp_uptr_array_extend_alloc(const Allocator *allocator, UptrArray *array, const UptrArray *other); UptrArray *wapp_uptr_array_copy_alloc(const Allocator *allocator, const UptrArray *src, UptrArray *dst); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #endif // !ARRAY_H diff --git a/src/primitives/dbl_list/dbl_list.h b/src/primitives/dbl_list/dbl_list.h index a7a9f24..17e2d11 100644 --- a/src/primitives/dbl_list/dbl_list.h +++ b/src/primitives/dbl_list/dbl_list.h @@ -9,10 +9,6 @@ #include "../../common/platform/platform.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #define wapp_str8_list_node(ITEM_PTR) ((Str8Node){.item = ITEM_PTR}) #define wapp_void_ptr_list_node(ITEM_PTR) ((VoidPNode){.item = ITEM_PTR}) #define wapp_bool_list_node(ITEM_PTR) ((BoolNode){.item = ITEM_PTR}) @@ -477,8 +473,4 @@ UptrNode *wapp_uptr_list_pop_back(UptrList *list); UptrNode *wapp_uptr_list_remove(UptrList *list, u64 index); void wapp_uptr_list_empty(UptrList *list); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #endif // !DBL_LIST_H diff --git a/src/primitives/mem_allocator/mem_allocator.h b/src/primitives/mem_allocator/mem_allocator.h index b9b0993..6bb15f3 100644 --- a/src/primitives/mem_allocator/mem_allocator.h +++ b/src/primitives/mem_allocator/mem_allocator.h @@ -5,17 +5,12 @@ #include "../../common/platform/platform.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef void *(MemAllocFunc)(u64 size, void *alloc_obj); typedef void *(MemAllocAlignedFunc)(u64 size, u64 alignment, void *alloc_obj); typedef void *(MemReallocFunc)(void *ptr, u64 old_size, u64 new_size, void *alloc_obj); typedef void *(MemReallocAlignedFunc)(void *ptr, u64 old_size, u64 new_size, u64 alignment, void *alloc_obj); typedef void (MemFreeFunc)(void **ptr, u64 size, void *alloc_obj); - typedef struct allocator Allocator; struct allocator { void *obj; @@ -28,7 +23,6 @@ struct allocator { #define wapp_mem_allocator_invalid(ALLOCATOR) (memcmp(ALLOCATOR, &((Allocator){0}), sizeof(Allocator)) == 0) - void *wapp_mem_allocator_alloc(const Allocator *allocator, u64 size); void *wapp_mem_allocator_alloc_aligned(const Allocator *allocator, u64 size, u64 alignment); void *wapp_mem_allocator_realloc(const Allocator *allocator, void *ptr, u64 old_size, u64 new_size); @@ -36,8 +30,4 @@ void *wapp_mem_allocator_realloc_aligned(const Allocator *allocator, void *ptr, u64 new_size, u64 alignment); void wapp_mem_allocator_free(const Allocator *allocator, void **ptr, u64 size); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !MEM_ALLOCATOR_H diff --git a/src/primitives/strings/str8/str8.h b/src/primitives/strings/str8/str8.h index 1b55fd2..390e8e4 100644 --- a/src/primitives/strings/str8/str8.h +++ b/src/primitives/strings/str8/str8.h @@ -8,10 +8,6 @@ #include #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - typedef struct str8 Str8; struct str8 { u64 capacity; @@ -96,8 +92,4 @@ Str8 *wapp_str8_join(const Allocator *allocator, const Str8List *list, Str8R #define wapp_str8_node_from_str8(STRING) wapp_str8_list_node(&(STRING)) u64 wapp_str8_list_total_size(const Str8List *list); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // !WAPP_PLATFORM_CPP - #endif // !STR8_H diff --git a/src/prng/xorshift/xorshift.c b/src/prng/xorshift/xorshift.c index 46ebbd8..38c4eaf 100644 --- a/src/prng/xorshift/xorshift.c +++ b/src/prng/xorshift/xorshift.c @@ -88,7 +88,7 @@ internal u64 split_mix_64(SplitMix64State *state) { return result ^ (result >> 31); } -#if defined(WAPP_PLATFORM_CPP) || (defined(WAPP_PLATFORM_C) && WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C11_VERSION) +#if defined(WAPP_PLATFORM_C) && WAPP_PLATFORM_C_VERSION >= WAPP_PLATFORM_C11_VERSION #ifdef WAPP_PLATFORM_POSIX internal void seed_os_generator(void) { struct timespec ts = {0}; @@ -131,4 +131,4 @@ internal u64 generate_random_number(void) { return (((u64)n1) << 32 | (u64)n2); } -#endif // !WAPP_PLATFORM_CPP +#endif // !WAPP_PLATFORM_C diff --git a/src/prng/xorshift/xorshift.h b/src/prng/xorshift/xorshift.h index e2643a7..621fa93 100644 --- a/src/prng/xorshift/xorshift.h +++ b/src/prng/xorshift/xorshift.h @@ -4,10 +4,6 @@ #include "../../common/aliases/aliases.h" #include "../../common/platform/platform.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - typedef struct xor_256_state XOR256State; struct xor_256_state { u64 x; @@ -21,8 +17,4 @@ u64 wapp_prng_xorshift_256(XOR256State *state); u64 wapp_prng_xorshift_256ss(XOR256State *state); u64 wapp_prng_xorshift_256p(XOR256State *state); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !XORSHIFT_H diff --git a/src/testing/tester/tester.h b/src/testing/tester/tester.h index 4d7a725..b9d346c 100644 --- a/src/testing/tester/tester.h +++ b/src/testing/tester/tester.h @@ -6,10 +6,6 @@ #include "../../primitives/strings/str8/str8.h" #include -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #define wapp_tester_result(PASSED) ((TestFuncResult){.name = wapp_str8_lit_ro(__func__), .passed = PASSED}) #define wapp_tester_run_tests(...) run_tests(__VA_ARGS__, NULL) @@ -27,8 +23,4 @@ typedef TestFuncResult(TestFunc)(void); void run_tests(TestFunc *func1, ...); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TESTER_H diff --git a/src/uuid/uuid.h b/src/uuid/uuid.h index cdcdd4b..e2662eb 100644 --- a/src/uuid/uuid.h +++ b/src/uuid/uuid.h @@ -5,10 +5,6 @@ #include "../common/platform/platform.h" #include "../primitives/strings/str8/str8.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #define UUID_BUF_LENGTH 48 #define WAPP_UUID_SPEC WAPP_STR8_SPEC #define wapp_uuid_varg(UUID) wapp_str8_varg((UUID).uuid) @@ -28,8 +24,4 @@ struct uuid { // If the pointer is NULL, it skips initialisation. UUID *wapp_uuid_init_uuid4(UUID *uuid); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !UUID_H diff --git a/tests/allocator/test_allocator.h b/tests/allocator/test_allocator.h index dd14632..44b4e69 100644 --- a/tests/allocator/test_allocator.h +++ b/tests/allocator/test_allocator.h @@ -3,14 +3,6 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_arena_allocator(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_ALLOCATOR_H diff --git a/tests/arena/test_arena.h b/tests/arena/test_arena.h index 3058b36..87b4df9 100644 --- a/tests/arena/test_arena.h +++ b/tests/arena/test_arena.h @@ -3,10 +3,6 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_arena_init(void); TestFuncResult test_arena_init_succeeds_when_reserving_very_large_size(void); TestFuncResult test_arena_alloc_succeeds_when_within_capacity(void); @@ -16,8 +12,4 @@ TestFuncResult test_arena_realloc_smaller_size(void); TestFuncResult test_arena_clear(void); TestFuncResult test_arena_destroy(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_ARENA_H diff --git a/tests/array/test_i32_array.h b/tests/array/test_i32_array.h index 7dcf919..6fdda5e 100644 --- a/tests/array/test_i32_array.h +++ b/tests/array/test_i32_array.h @@ -3,10 +3,6 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_i32_array(void); TestFuncResult test_i32_array_with_capacity(void); TestFuncResult test_i32_array_get(void); @@ -21,8 +17,4 @@ TestFuncResult test_i32_array_append_alloc(void); TestFuncResult test_i32_array_extend_alloc(void); TestFuncResult test_i32_array_copy_alloc(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_INT_ARRAY_H diff --git a/tests/cpath/test_cpath.h b/tests/cpath/test_cpath.h index f3c0377..6613009 100644 --- a/tests/cpath/test_cpath.h +++ b/tests/cpath/test_cpath.h @@ -3,16 +3,8 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_cpath_join_path(void); TestFuncResult test_cpath_dirname(void); TestFuncResult test_cpath_dirup(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_CPATH_H diff --git a/tests/shell_commander/test_shell_commander.h b/tests/shell_commander/test_shell_commander.h index b57b7d3..ea547c7 100644 --- a/tests/shell_commander/test_shell_commander.h +++ b/tests/shell_commander/test_shell_commander.h @@ -3,17 +3,9 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_commander_cmd_success(void); TestFuncResult test_commander_cmd_failure(void); TestFuncResult test_commander_cmd_out_buf_success(void); TestFuncResult test_commander_cmd_out_buf_failure(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_SHELL_COMMANDER_H diff --git a/tests/str8/test_str8.h b/tests/str8/test_str8.h index eb49935..5ed90c0 100644 --- a/tests/str8/test_str8.h +++ b/tests/str8/test_str8.h @@ -3,10 +3,6 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_str8_lit(void); TestFuncResult test_str8_lit_ro(void); TestFuncResult test_str8_buf(void); @@ -33,8 +29,4 @@ TestFuncResult test_str8_rsplit(void); TestFuncResult test_str8_rsplit_with_max(void); TestFuncResult test_str8_join(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_STR8_H diff --git a/tests/str8/test_str8_list.h b/tests/str8/test_str8_list.h index b0c6fbe..963227e 100644 --- a/tests/str8/test_str8_list.h +++ b/tests/str8/test_str8_list.h @@ -3,10 +3,6 @@ #include "wapp.h" -#ifdef WAPP_PLATFORM_CPP -BEGIN_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - TestFuncResult test_str8_list_get(void); TestFuncResult test_str8_list_push_front(void); TestFuncResult test_str8_list_push_back(void); @@ -16,8 +12,4 @@ TestFuncResult test_str8_list_pop_back(void); TestFuncResult test_str8_list_remove(void); TestFuncResult test_str8_list_empty(void); -#ifdef WAPP_PLATFORM_CPP -END_C_LINKAGE -#endif // WAPP_PLATFORM_CPP - #endif // !TEST_STR8_LIST_H