added driver framework to prepare for driver unification, fixed USB driver, added...
[rpi-open-firmware.git] / lib / panic.h
1 #pragma once
2
3 #ifdef __cplusplus
4 extern "C" {
5 #endif
6
7 extern void panic(const char* fmt, ...)
8 __attribute__((noreturn))
9 __attribute__ ((format (printf, 1, 2)));
10
11 #define panic_plain(ex, ...) \
12 (panic)(ex, ## __VA_ARGS__)
13 #define __STRINGIFY(x) #x
14 #define LINE_NUMBER(x) __STRINGIFY(x)
15 #define PANIC_LOCATION __FILE__ ":" LINE_NUMBER(__LINE__)
16 #define panic(ex, ...) \
17 (panic)(# ex "@" PANIC_LOCATION, ## __VA_ARGS__)
18
19 #define assert(x) if (!(x)) { panic("assertion '%s' failed", #x); }
20
21 #ifdef __cplusplus
22 }
23 #endif
This page took 0.061679 seconds and 4 git commands to generate.