some collected macros for C++

类别:VC语言 点击:0 评论:0 推荐:
#define ARRAY_SIZE(X) sizeof(X)/sizeof(X[0]) #define WIDEN2(x) L ## x #define WIDEN(x) WIDEN2(x) #define __WFILE__ WIDEN(__FILE__) #define __WFUNCTION__ WIDEN(__FUNCTION__) #ifdef _UNICODE #define __TFILE__ __WFILE__ #define __TFUNCTION__ __WFUNCTION__ #else #define __TFILE__ __FILE__ #define __TFUNCTION__ __FUNCTION__ #endif #define __STR2__(x) #x #define __STR1__(x) __STR2__(x) //#define __LOC__ __FILE__ "("__STR1__(__LINE__)") : Warning Msg: " #define __LOC2__ __FILE__ "("__STR1__(__LINE__)") " #define __FLOC__ __TFILE__ "("__STR1__(__LINE__)"): " #define __MLOC__ __TFUNCTION__ "("__STR1__(__LINE__)"): " const int PATH_LEN = 1024+MAX_PATH;

本文地址:http://com.8s8s.com/it/it632.htm