#include <assert.h>
#include <stdlib.h>
#include <stdio.h>
Go to the source code of this file.
◆ ASSERT
#define ASSERT |
( |
| expr, |
|
|
| ... ) |
Value: if (!(expr)) { \
PANIC("assertion " #expr " failed: " __VA_ARGS__ "\n"); \
}
- Examples
- structures/hashmap.c.
Definition at line 16 of file panic.h.
16#define ASSERT(expr, ...) \
17 if (!(expr)) { \
18 PANIC("assertion " #expr " failed: " __VA_ARGS__ "\n"); \
19 }
◆ DEBUG_ASSERT
#define DEBUG_ASSERT |
( |
| expr | ) |
|
Value:
Definition at line 23 of file panic.h.
◆ PANIC
Value: do { \
fprintf(stderr, __VA_ARGS__); \
abort(); \
} while (0);
Definition at line 8 of file panic.h.
8#define PANIC(...) \
9 do { \
10 fprintf(stderr, __VA_ARGS__); \
11 abort(); \
12 } while (0);