sketchbook
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
bug.h
Go to the documentation of this file.
1 #ifndef BUG_H
2 #define BUG_H
3 
4 #define __linktime_error(message) __attribute__((__error__(message)))
5 
6 #ifndef __OPTIMIZE__
7 #define BUILD_BUG_ON(condition) ((void)sizeof(char[1 - 2*!!(condition)]))
8 #else
9 
10 #ifndef P
11 #define P(s) ({static const char c[] __attribute__ ((progmem)) = s;c;})
12 #endif
13 
14 extern void __build_bug_failed(void);
15 #define BUILD_BUG_ON(condition) \
16  do { \
17  ((void)sizeof(char[1 - 2*!!(condition)])); \
18  if (condition) __build_bug_failed(); \
19  } while(0)
20 #endif
21 
29 #define BUILD_BUG() \
30  do { \
31  __build_bug_failed(); \
32  } while (0)
33 
34 #ifdef DEBUG
35 // #include <debug.h>
36 extern void die(const char *s __attribute__((progmem)));
37 #define BUG(s) die(P(s))
38 #else
39 #define BUG(s) do {} while(1) // depends on watchdog
40 #endif // !DEBUG
41 
42 #endif // LIB_BUG
tuple s
Definition: ser-mon-AS7265X.py:36
char __v64qi __attribute__((__vector_size__(64)))
Definition: avx512bwintrin.h:33
void die(const char *s __attribute__((progmem))) __attribute__((noreturn))
Definition: bug.c:4