Changeset 25 in libcf for trunk/include/cf_debug.h


Ignore:
Timestamp:
02/02/13 17:27:06 (11 years ago)
Author:
cheese
Message:

#1 fix logging bug and debugging macros

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/include/cf_debug.h

    r21 r25  
    1919
    2020#ifdef _DEBUG
     21# define CF_DEBUG_CREATE_CTX()                                      \
     22    CF_Debug_CreateCtx ()
     23
     24# define CF_DEBUG_DESTROY_CTX(__ctx)                                \
     25    CF_Debug_DestroyCtx (__ctx)
     26
    2127# define CF_UPDATE_CTX(__ctx)                                       \
    2228    CF_Debug_UpdateCtx (__ctx,__FILE__,__func__,__LINE__)
     29
    2330# define CF_DEBUG_PRINT(__fp,__fmt,...)                             \
    2431    CF_Debug_Print (__fp,__FILE__,__func__,__LINE__,__fmt,##__VA_ARGS__)
     32
    2533# define CF_DEBUG_PRINT_BIN(__fp,__bin,__len,__fmt,...)             \
    2634    CF_Debug_PrintBin (__fp,__FILE__,__func__,__LINE__,__bin,__len,__fmt,##__VA_ARGS__)
     35
    2736# define CF_DEBUG_TRACE(__ctx,__fmt,...)                            \
    2837    do {                                                            \
     
    3039    CF_Debug_Trace (__ctx,__fmt,##__VA_ARGS__);                     \
    3140    } while (0)
     41
    3242# define CF_DEBUG_TRACE_BIN(__ctx,__bin,__len,__fmt,...)            \
    3343    do {                                                            \
     
    3545    CF_Debug_TraceBin (__ctx,__bin,__len,__fmt,##__VA_ARGS__);      \
    3646    } while (0)
     47
    3748# define CF_DEBUG_CALLSTACK_PUSH(__ctx)                             \
    3849    CF_Debug_CallStackPush (__ctx,__FILE__,__func__,__LINE__)
     50
    3951# define CF_DEBUG_CALLSTACK_POP                                     \
    4052    CF_Debug_CallStackPop
    4153#else // #ifdef _DEBUG
     54# define CF_DEBUG_CREATE_CTX()                          NULL
     55# define CF_DEBUG_DESTROY_CTX(__ctx)
    4256# define CF_UPDATE_CTX(__ctx)
     57# define CF_DEBUG_PRINT(__fp,__fmt,...)
     58# define CF_DEBUG_PRINT_BIN(__fp,__bin,__len,__fmt,...)
    4359# define CF_DEBUG_TRACE(__ctx,__fmt,...)
    4460# define CF_DEBUG_TRACE_BIN(__ctx,__bin,__len,__fmt,...)
    4561# define CF_DEBUG_CALLSTACK_PUSH(__ctx)
    46 # define CF_DEBUG_CALLSTACK_POP()
     62# define CF_DEBUG_CALLSTACK_POP(__ctx,__callstack)      1
    4763#endif // #ifdef _DEBUG
    4864
Note: See TracChangeset for help on using the changeset viewer.