picofuse

assert.h
Go to the documentation of this file.
1 
9 #pragma once
10 #include "panicf.h"
11 
20 #ifndef NDEBUG
21 #define sys_assert(condition) \
22  do { \
23  if (!(condition)) { \
24  sys_panicf("[ASSERT] FAIL: %s, file %s, line %d", #condition, __FILE__, \
25  __LINE__); \
26  } \
27  } while (0)
28 #else
29 #define sys_assert(condition) \
30  do { \
31  if (!(condition)) { \
32  sys_panicf("[ASSERT] FAIL: %s", #condition); \
33  } \
34  } while (0)
35 #endif
Defines the sys_panicf function for formatted panic messages.