Apply adapted patch from joerg@ to fix clang build.

This commit is contained in:
alnsn 2012-11-09 23:09:31 +00:00
parent 922089c955
commit 929b2d397c
2 changed files with 10 additions and 9 deletions

View File

@ -74,11 +74,16 @@
#endif
#ifdef _KERNEL
#ifdef DIAGNOSTIC
#define SLJIT_DEBUG 1
#else
#define SLJIT_DEBUG 0
#endif
#define SLJIT_ASSERT(x) KASSERT(x)
#define SLJIT_ASSERT_STOP() \
panic("Should never been reached " __FILE__ ":%d\n", __LINE__)
#endif
#ifdef _KERNEL

View File

@ -415,16 +415,12 @@ SLJIT_API_FUNC_ATTRIBUTE void sljit_free_exec(void* ptr);
/* Feel free to redefine these two macros. */
#ifndef SLJIT_ASSERT
#define SLJIT_HALT_PROCESS() \
*((int*)0) = 0
#include <assert.h>
#include <stdlib.h>
#define SLJIT_ASSERT(x) \
do { \
if (SLJIT_UNLIKELY(!(x))) { \
printf("Assertion failed at " __FILE__ ":%d\n", __LINE__); \
SLJIT_HALT_PROCESS(); \
} \
} while (0)
#define SLJIT_HALT_PROCESS() abort()
#define SLJIT_ASSERT(x) assert(x)
#endif /* !SLJIT_ASSERT */