AutosarOS
assert.h
Go to the documentation of this file.
1 
15 #ifndef ASSERT_H_
16 #define ASSERT_H_
17 
18 #include <stdio.h>
19 #include <stdlib.h>
20 #include <string.h>
21 
22 #if defined(__DOXYGEN__)
23 
37 #define assert(expression)
38 
54 #define assertMsg(expression, message)
55 
65 #define ASSERT_BUFFER_SIZE size
66 
72 #define STATIC_ASSERT_BUFFER
73 
81 #define BREAK_ON_ASSERT
82 
83 #else /* !DOXYGEN */
84 
85 #ifdef NDEBUG
86 #define assert(exp) ((void)0)
87 #define assertMsg(exp, msg) ((void)0)
88 #else
89 #define assert(exp) ((exp) ? (void)0 : __assert(__FILE__, __LINE__, #exp))
90 #define assertMsg(exp, msg) ((exp) ? (void)0 : __assert(__FILE__, __LINE__, msg))
91 #endif /* NDEBUG */
92 
93 
94 #ifdef __cplusplus
95 extern "C" {
96 #endif
97 
98 extern void __assert(const char* file, const int line, const char* msg);
99 
100 #ifdef __cplusplus
101 }
102 #endif /* __cplusplus */
103 #endif /* DOXYGEN */
104 
105 #endif /* ASSERT_H_ */
__assert
void __assert(const char *file, const int line, const char *msg)
Definition: assert.c:16