2 Commits

Author SHA1 Message Date
abdelrahman c6560ab7f5 Add windows pragma to slience warning in runtime assert 2025-12-15 19:54:04 +00:00
abdelrahman 04858b76c0 Add WIN32_LEAN_AND_MEAN 2025-12-15 19:53:20 +00:00
2 changed files with 26 additions and 10 deletions
+16 -1
View File
@@ -27,8 +27,24 @@ BEGIN_C_LINKAGE
#define wapp_debug_assert(EXPR, MSG)
#endif
#ifdef WAPP_PLATFORM_WINDOWS
#define __wapp_runtime_assert(EXPR, MSG) do { \
__pragma(warning(push)) \
__pragma(warning(disable:4127)) \
if (!(EXPR)) { \
__pragma(warning(pop)) \
__runtime_assert_failed(EXPR, MSG); \
} \
} while(false)
#else
#define __wapp_runtime_assert(EXPR, MSG) do { \
if (!(EXPR)) { \
__runtime_assert_failed(EXPR, MSG); \
} \
} while(false)
#endif // !WAPP_PLATFORM_WINDOWS
#define __runtime_assert_failed(EXPR, MSG) do { \
fprintf( \
stderr, \
"%s:%d (In function `%s`): Assertion failed (%" PRIu32 ")\nDiagnostic: %s\n\n", \
@@ -36,7 +52,6 @@ BEGIN_C_LINKAGE
EXPR, MSG \
); \
abort(); \
} \
} while(false)
#ifdef WAPP_PLATFORM_CPP
+1
View File
@@ -17,6 +17,7 @@ BEGIN_C_LINKAGE
#define WAPP_PATH_SEP '/'
#define WAPP_PATH_MAX PATH_MAX
#elif defined(WAPP_PLATFORM_WINDOWS)
#define WIN32_LEAN_AND_MEAN
#include <windows.h>
#define WAPP_PATH_SEP '\\'
#define WAPP_PATH_MAX MAX_PATH