2 * @brief General purpose macros.
11 #define model_print(fmt, ...) do { printf(fmt, ##__VA_ARGS__); } while (0)
14 #define DEBUG(fmt, ...) do { model_print("*** %25s(): line %-4d *** " fmt, __func__, __LINE__, ##__VA_ARGS__); } while (0)
15 #define DBG() DEBUG("\n")
16 #define DBG_ENABLED() (1)
18 #define DEBUG(fmt, ...)
20 #define DBG_ENABLED() (0)
23 void assert_hook(void);
26 #define ASSERT(expr) \
29 fprintf(stderr, "Error: assertion failed in %s at line %d\n", __FILE__, __LINE__); \
31 model_print_summary(); \
37 #define ASSERT(expr) \
39 #endif /* CONFIG_ASSERT */
41 #define error_msg(...) fprintf(stderr, "Error: " __VA_ARGS__)
43 void print_trace(void);
44 void model_print_summary(void);
45 #endif /* __COMMON_H__ */