Compare commits

3 Commits

Author SHA1 Message Date
996f9d4ff9 Update wapp_array_pop to fix MSVC warning 2026-01-02 16:10:41 +00:00
c433f9aaa3 Fix MSVC includes 2026-01-02 16:10:22 +00:00
ea426f43df Remove MSVC codegen 2026-01-02 16:10:09 +00:00
5 changed files with 6 additions and 9 deletions

View File

@@ -52,9 +52,6 @@ mkdir -p $ObjDir > $null
mkdir -p $OutDir > $null
mkdir -p $TestsDir > $null
# Run code generation
Invoke-Expression "python -m codegen"
# Build and run C tests
Invoke-Expression "$Compiler $GeneralFlags $CStd $IncludeDirs $TestIncludeDirs $SrcFiles $TestCSrcFiles $TestCOutputFlags" -ErrorAction Stop
Invoke-Expression "$TestsDir/$TestCOutputBasename.exe"

View File

@@ -8,7 +8,7 @@
#include <stddef.h>
#define _offset_pointer(PTR, OFFSET) ((void *)((uptr)(PTR) + (OFFSET)))
#define _array_header(ARRAY) (ArrayHeader *)(_offset_pointer(ARRAY, -sizeof(ArrayHeader)))
#define _array_header(ARRAY) (ArrayHeader *)(_offset_pointer(ARRAY, (i64)sizeof(ArrayHeader) * -1))
wapp_persist inline void _array_validate(const GenericArray array, u64 item_size);

View File

@@ -110,9 +110,9 @@ typedef Str8 *Str8Array;
}.items \
)
#define wapp_array_pop(TYPE, ARRAY) \
(ARRAY != NULL && _array_count((GenericArray)ARRAY) > 0 ? \
*((TYPE *)_array_pop((GenericArray)ARRAY, sizeof(TYPE))) : \
(TYPE){0} \
(ARRAY == NULL || _array_count((GenericArray)ARRAY) == 0 ? \
(TYPE){0} : \
*((TYPE *)_array_pop((GenericArray)ARRAY, sizeof(TYPE))) \
)
#endif // !WAPP_PLATFORM_CPP

View File

@@ -32,7 +32,7 @@ struct CMDResult {
b8 exited;
#ifdef WAPP_PLATFORM_WINDOWS
#include "../../../../common/misc/misc_utils.h"
#include "../../../common/misc/misc_utils.h"
wapp_misc_utils_padding_size(sizeof(b8) + sizeof(i32) + sizeof(CMDError));
#endif // !WAPP_PLATFORM_WINDOWS
};

View File

@@ -7,7 +7,7 @@
#ifdef WAPP_PLATFORM_WINDOWS
#include "../terminal_colours.h"
#include "../../../../../common/misc/misc_utils.h"
#include "../../../../common/misc/misc_utils.h"
#include <stdio.h>
#define WIN32_LEAN_AND_MEAN