objc

assert.h
Go to the documentation of this file.
1 
8 #pragma once
9 
18 #ifdef DEBUG
19 #define sys_assert(condition) \
20  if (!(condition)) { \
21  sys_panicf("ASSERT FAIL: %s, file %s, line %d", #condition, __FILE__, \
22  __LINE__); \
23  }
24 #else
25 #define sys_assert(condition) \
26  if (!(condition)) { \
27  sys_panicf("ASSERT FAIL: %s", #condition); \
28  }
29 #endif
30 
31 #ifdef __cplusplus
32 extern "C" {
33 #endif
34 
44 extern void sys_abort(void);
45 
53 extern void sys_panicf(const char *fmt, ...);
54 
55 #ifdef __cplusplus
56 }
57 #endif
void sys_panicf(const char *fmt,...)
Prints a formatted panic message and aborts the process.
void sys_abort(void)
Aborts the current process immediately.