跳到主要內容

MACRO

#define ARRAY_LEN(array) ((sizeof(array)) / (sizeof(array[0])))

#define CLEAN_BUFFER(buf) memset((buf), 0x0, (ARRAY_LEN(buf)))

#if __DEBUG
    #define DEBUG_STRING(stream, format, arg...) fprintf(stream, format, ##arg)
#else
    #define DEBUG_STRING(stream, format, arg...) ;
#endif

#define CONTRARY(x) ((x) ? 0 : 1)
#define COMPARE_NUMBER(a, b) (((a) == (b)) ? 0 : (((a) > (b)) ? 1 : -1))

留言