This commit is contained in:
krzosa
2025-01-03 22:14:34 +01:00
parent de12ea371e
commit 1fca44fcfc
11 changed files with 190 additions and 168 deletions

View File

@@ -26,11 +26,11 @@ typedef double f64;
#endif
#define fn
#define global
#define gb
#define locl
#if PLATFORM_WASM
#define glb_wasm_export __attribute__((visibility("default")))
#define gb_wasm_export __attribute__((visibility("default")))
#define fn_wasm_export __attribute__((visibility("default")))
#define fn_wasm_import
#endif
@@ -77,6 +77,23 @@ typedef double f64;
#define SWAP(t, a, b) do { t PASTE(temp__, __LINE__) = a; a = b; b = PASTE(temp__, __LINE__); } while(0)
#define CODE(...) #__VA_ARGS__
#if PLATFORM_CL || (PLATFORM_CLANG && PLATFORM_WINDOWS)
#pragma section(".rdata$", read)
#define gb_read_only __declspec(allocate(".rdata$"))
#elif PLATFORM_CLANG && PLATFORM_LINUX
#define gb_read_only __attribute__((section(".rodata")))
#else
#define gb_read_only
#endif
#if PLATFORM_CL
#define fn_force_inline __forceinline
#elif PLATFORM_CLANG || PLATFORM_GCC
#define fn_force_inline __attribute__((always_inline))
#else
#define fn_force_inline
#endif
#ifndef FILE_AND_LINE_GCC_FORMAT
#define FILE_AND_LINE __FILE__"("STRINGIFY(__LINE__)")"
#else