formatted code.
This commit is contained in:
+29
-20
@@ -26,56 +26,65 @@
|
||||
|
||||
/************************** Constant Definitions *****************************/
|
||||
/***************** Macros (Inline Functions) Definitions *********************/
|
||||
#define __PRINT_BLOCK(block) do {\
|
||||
block\
|
||||
} while(0)
|
||||
#define __PRINT_BLOCK(block) \
|
||||
do \
|
||||
{ \
|
||||
block \
|
||||
} while (0)
|
||||
|
||||
#define ASSERT(exp) ((exp) ? (void)0 : AppAssert(__FILE__, __LINE__))
|
||||
#define _nop_() __asm__("nop")
|
||||
#define _nop_() __asm__("nop")
|
||||
|
||||
/* Stringify */
|
||||
#define STR(x) #x
|
||||
#define STR(x) #x
|
||||
|
||||
// #define _814_DEBUG_LEVEL 3
|
||||
|
||||
#if _814_DEBUG_LEVEL > 0
|
||||
#define DBG_PRINT(...) printf(__VA_ARGS__)
|
||||
#define DBG_PRINT(...) printf(__VA_ARGS__)
|
||||
#endif
|
||||
#if _814_DEBUG_LEVEL >= 1
|
||||
#define DBG_ERROR(...) __PRINT_BLOCK( \
|
||||
printf("[error]\tin "__FILE__":%4d ",__LINE__); \
|
||||
printf(__VA_ARGS__); \
|
||||
)
|
||||
printf("[error]\tin "__FILE__ \
|
||||
":%4d ", \
|
||||
__LINE__); \
|
||||
printf(__VA_ARGS__);)
|
||||
#endif
|
||||
#if _814_DEBUG_LEVEL >= 2
|
||||
#define DBG_WARNING(...) __PRINT_BLOCK( \
|
||||
printf("[warning]\t"); \
|
||||
printf(__VA_ARGS__); \
|
||||
)
|
||||
printf("[warning]\t"); \
|
||||
printf(__VA_ARGS__);)
|
||||
#endif
|
||||
#if _814_DEBUG_LEVEL >= 3
|
||||
#define DBG_INFO(...) __PRINT_BLOCK( \
|
||||
printf("[Info]\t"); \
|
||||
printf(__VA_ARGS__); \
|
||||
)
|
||||
printf("[Info]\t"); \
|
||||
printf(__VA_ARGS__);)
|
||||
#endif
|
||||
|
||||
#ifndef DBG_ERROR
|
||||
#define DBG_ERROR(...) {}
|
||||
#define DBG_ERROR(...) \
|
||||
{ \
|
||||
}
|
||||
#endif
|
||||
#ifndef DBG_WARNING
|
||||
#define DBG_WARNING(...) {}
|
||||
#define DBG_WARNING(...) \
|
||||
{ \
|
||||
}
|
||||
#endif
|
||||
#ifndef DBG_INFO
|
||||
#define DBG_INFO(...) {}
|
||||
#define DBG_INFO(...) \
|
||||
{ \
|
||||
}
|
||||
#endif
|
||||
#ifndef DBG_PRINT
|
||||
#define DBG_PRINT(...) {}
|
||||
#define DBG_PRINT(...) \
|
||||
{ \
|
||||
}
|
||||
#endif
|
||||
/**************************** Type Definitions *******************************/
|
||||
|
||||
/************************** Variable Definitions *****************************/
|
||||
|
||||
/************************** Function Prototypes ******************************/
|
||||
void AppAssert(const char * file, int line);
|
||||
void AppAssert(const char *file, int line);
|
||||
#endif /* __COMMON_H_ */
|
||||
|
||||
Reference in New Issue
Block a user