mirror of
https://github.com/mupen64plus/mupen64plus-oldsvn.git
synced 2025-04-02 10:52:35 -04:00
21 lines
504 B
C
21 lines
504 B
C
#ifndef _RGL_ASSERT_H_
|
|
#define _RGL_ASSERT_H_
|
|
|
|
#include <stdio.h>
|
|
|
|
#ifdef RGL_ASSERT
|
|
inline void _rglAssert(int test, const char * s, int line, const char * file) {
|
|
if (!test) {
|
|
fprintf(stderr, "z64 assert failed (%s : %d) : %s\n", file, line, s);
|
|
fflush(stdout);
|
|
fflush(stderr);
|
|
*(unsigned int *)0 = 0xdeadbeef; // hopefully will generate a segfault
|
|
exit(-1);
|
|
}
|
|
}
|
|
#define rglAssert(test) _rglAssert((test), #test, __LINE__, __FILE__)
|
|
#else
|
|
#define rglAssert(test)
|
|
#endif
|
|
|
|
#endif
|