This commit is contained in:
@@ -16,7 +16,7 @@ BEGIN_C_LINKAGE
|
||||
#define wpStaticAssert(EXPR, MSG) wp_extern char ASSERTION_FAILED[EXPR ? 1 : -1]
|
||||
|
||||
#ifndef WP_NO_RUNTIME_ASSERT
|
||||
#define wpRuntimeAssert(EXPR, MSG) _runtimeAssert(EXPR, MSG)
|
||||
#define wpRuntimeAssert(EXPR, MSG) runtimeAssert(EXPR, MSG)
|
||||
#else
|
||||
#define wpRuntimeAssert(EXPR, MSG)
|
||||
#endif
|
||||
@@ -28,23 +28,23 @@ BEGIN_C_LINKAGE
|
||||
#endif
|
||||
|
||||
#ifdef WP_PLATFORM_WINDOWS
|
||||
#define _runtimeAssert(EXPR, MSG) do { \
|
||||
#define runtimeAssert(EXPR, MSG) do { \
|
||||
__pragma(warning(push)) \
|
||||
__pragma(warning(disable:4127)) \
|
||||
if (!(EXPR)) { \
|
||||
__pragma(warning(pop)) \
|
||||
_runtimeAssertFailed(EXPR, MSG); \
|
||||
runtimeAssertFailed(EXPR, MSG); \
|
||||
} \
|
||||
} while(false)
|
||||
#else
|
||||
#define _runtimeAssert(EXPR, MSG) do { \
|
||||
#define runtimeAssert(EXPR, MSG) do { \
|
||||
if (!(EXPR)) { \
|
||||
_runtimeAssertFailed(EXPR, MSG); \
|
||||
runtimeAssertFailed(EXPR, MSG); \
|
||||
} \
|
||||
} while(false)
|
||||
#endif // !WP_PLATFORM_WINDOWS
|
||||
|
||||
#define _runtimeAssertFailed(EXPR, MSG) do { \
|
||||
#define runtimeAssertFailed(EXPR, MSG) do { \
|
||||
fprintf( \
|
||||
stderr, \
|
||||
"%s:%d (In function `%s`): Assertion failed (%" PRIu32 ")\nDiagnostic: %s\n\n", \
|
||||
|
||||
Reference in New Issue
Block a user