7 #if FW_ASSERT_LEVEL == FW_NO_ASSERT
10 #define FW_STATIC_ASSERT(...)
12 #else // ASSERT is defined
14 #define FW_STATIC_CAT_(a, b) a ## b
15 #define FW_STATIC_CAT(a, b) FW_STATIC_CAT_(a, b)
16 #define FW_STATIC_ASSERT(cond) typedef int FW_STATIC_CAT(FW_STATIC_ASSERT,__LINE__)[(cond) ? 1 : -1]
18 #if FW_ASSERT_LEVEL == FW_FILEID_ASSERT
19 #define FILE_NAME_ARG NATIVE_UINT_TYPE
20 #define FW_ASSERT(cond, ...) \
21 ((void) ((cond) ? (0) : \
22 (Fw::SwAssert(ASSERT_FILE_ID, __LINE__, ##__VA_ARGS__))))
24 #define FILE_NAME_ARG U8*
25 #define FW_ASSERT(cond, ...) \
26 ((void) ((cond) ? (0) : \
27 (Fw::SwAssert((U8*)__FILE__, __LINE__, ##__VA_ARGS__))))
33 #ifndef CLANG_ANALYZER_NORETURN
35 #define __has_feature(x) 0 // Compatibility with non-clang compilers.
37 #if __has_feature(attribute_analyzer_noreturn)
38 #define CLANG_ANALYZER_NORETURN __attribute__((analyzer_noreturn))
40 #define CLANG_ANALYZER_NORETURN
62 AssertHook() : previousHook(
NULL) {};
63 virtual ~AssertHook() {};
65 virtual void reportAssert(
78 virtual void printAssert(
const I8* msg);
81 virtual void doAssert(
void);
83 void registerHook(
void);
85 void deregisterHook(
void);
90 AssertHook *previousHook;
95 #endif // if ASSERT is defined