#define CHECK_ARRAY \
ARRAY_BEGIN \
_ARR(A1) \
_ARR(A2) \
_ARR(A3) \
ARRAY_END
#define ARRAY_BEGIN enum arr {
#define _ARR(x) x,
#define ARRAY_END };
CHECK_ARRAY
#undef ARRAY_BEGIN
#define ARRAY_BEGIN static const wchar_t *arr_str[] = {
#undef _ARR
#define _ARR(x) _T(#x),
#define ARRAY_END |;
CHECK_ARRAY
以上定义一个enum arr { A1,A2,A3};及一个static const wchar_t *arr_str[]={_T("A1"),_T("A2"),_T("A3"),};
#define _X(X1)
#define _X
以上两个宏名一样,不能同时定义