#include <assert.h>
#include <stdio.h>
#include <stdlib.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 15 of file panic.h.
15#define ASSERT(expr, ...) \
16 if (!(expr)) { \
17 PANIC("assertion " #expr " failed: " __VA_ARGS__ "\n"); \
18 }
◆ DEBUG_ASSERT
#define DEBUG_ASSERT |
( |
| expr | ) |
|
◆ PANIC
Value: do { \
fprintf(stderr, __VA_ARGS__); \
abort(); \
} while (0);
Definition at line 7 of file panic.h.
7#define PANIC(...) \
8 do { \
9 fprintf(stderr, __VA_ARGS__); \
10 abort(); \
11 } while (0);