Files
NJU_PA/nanos-lite/include/debug.h
zzy dfc38f6525 NJU-ProjectN/nanos-lite ics2021 initialized
NJU-ProjectN/nanos-lite 2a141760e31be246a7316942293a97873925bc2f Makefile: use header files in newlib-navy
2024-09-21 17:15:02 +08:00

31 lines
548 B
C

#ifndef __DEBUG_H__
#define __DEBUG_H__
#include <common.h>
#define Log(format, ...) \
printf("\33[1;35m[%s,%d,%s] " format "\33[0m\n", \
__FILE__, __LINE__, __func__, ## __VA_ARGS__)
#undef panic
#define panic(format, ...) \
do { \
Log("\33[1;31msystem panic: " format, ## __VA_ARGS__); \
halt(1); \
} while (0)
#ifdef assert
# undef assert
#endif
#define assert(cond) \
do { \
if (!(cond)) { \
panic("Assertion failed: %s", #cond); \
} \
} while (0)
#define TODO() panic("please implement me")
#endif