diff --git a/do.ps1 b/do.ps1 index 21478a6..2795255 100755 --- a/do.ps1 +++ b/do.ps1 @@ -114,7 +114,7 @@ function GetFlags($os, $release) { $flags += " $LINUX_FLAGS $BLOCKS_RT_FLAGS -DPLATFORM_LINUX"; } "emscripten" { - $flags += " $WASM_FLAGS $BLOCKS_RT_FLAGS -DPLATFORM_WASM -DPOINTER_32" + $flags += " $WASM_FLAGS $BLOCKS_RT_FLAGS -DPLATFORM_WASM -DARCH_32" } default { Write-Error "Unsupported operating system '$os'"; diff --git a/source/base.c b/source/base.c index 0f32ea1..e2d721a 100644 --- a/source/base.c +++ b/source/base.c @@ -23,7 +23,7 @@ typedef signed _BitInt(128) s128; typedef float f32; typedef double f64; -#if POINTER_32 +#if ARCH_32 typedef u32 uaddr; typedef s32 saddr; @@ -43,9 +43,9 @@ static_assert(sizeof(uaddr) == sizeof(void*), "uaddr was not equal to a pointer" typedef struct { u8* data; uword count; } string; -#define string_const(S) (string){ .data = (S), .count = count_of((S)) } #define string_from(P) (string){ .data = (P), .count = cast(uword, strlen((P))) } -#define string_from_count(P, C) (string){ .data = (P), .count = (C) } +#define string_from_const(S) (string){ .data = (S), .count = count_of((S)) } +#define string_with_count(P, C) (string){ .data = (P), .count = (C) } #define size_of(T) cast(uword, sizeof(T)) #define ssize_of(T) cast(sword, sizeof(T)) @@ -77,4 +77,3 @@ static inline void __scope_exit_run(__scope_exit *blk) { (*blk)(); } #define scope_exit \ __attribute__((cleanup(__scope_exit_run), unused)) \ __scope_exit __concat(_defer_, __LINE__) = ^void(void) -