1 /*******************************************************************************
5 * Created : Thu 22 Oct 2009 03:29:31 PM CST
7 ******************************************************************************/
9 #ifndef __DEBUG_INC_20091022_152931_HENRY__
10 #define __DEBUG_INC_20091022_152931_HENRY__
13 /*******************************************************************************
14 * Desc : Includes Files
15 ******************************************************************************/
18 #include "utils/typedef.h"
19 #include "utils/config.h"
20 #include "utils/HLH_Mutex.h"
23 /*******************************************************************************
24 * Desc : Macro Definations
25 ******************************************************************************/
28 //=========================== Assertion ======================================
30 #if (__USE_ASSERT__ != 0)
31 # define ASSERT(cond) \
34 HLH_DEBUG (HLH_DEBUG_MAIN, ("assert [ %s ] failed", #cond)); \
43 //=========================== Debug ==========================================
46 // 'info' must be surrounded by '()'
48 #if (__USE_HLH_DEBUG__ != 0)
50 # define HLH_DEBUG(flags, info) \
52 if ( (flags) & HLH_DEBUG_FLAGS ) { \
53 Printf ("%s: %s: %d: ", __FILE__, __FUNCTION__, __LINE__); \
60 # define HLH_DEBUG(flags, info)
63 #if (__TRACE_CALL__ != 0)
65 # define HLH_ENTER_FUNC(flags) \
67 HLH_DEBUG ( flags, ("Enter-----------------------------") ); \
70 # define HLH_EXIT_FUNC(flags) \
72 HLH_DEBUG ( flags, ("Exit -----------------------------") ); \
77 # define HLH_ENTER_FUNC(flags)
78 # define HLH_EXIT_FUNC(flags)
83 /*******************************************************************************
84 * Desc : Type Definations
85 ******************************************************************************/
88 /*******************************************************************************
90 ******************************************************************************/
93 /*******************************************************************************
94 * Desc : Extern Variables
95 ******************************************************************************/
96 extern HLH_AutoMutex g_zhmPrintMutex
;
99 /*******************************************************************************
101 ******************************************************************************/
102 extern int Printf (const char * pcFormat
, ...);
106 #endif /* __DEBUG_INC_20091022_152931_HENRY__ */