I want to concatenate two wide strings using a macro, so I define some macros:
#define VERSION_MAJOR 1
#define VERSION_MINOR 1
#define VERSION_BUILD 0
#define VERSION_REVISION 0
#define _STR(s) #s
#define STR(s) _STR(s)
#define _TOWSTRING(x) L##x
#define TOWSTRING(x) _TOWSTRING(x)
//http://stackoverflow.com/questions/240353/convert-a-preprocessor-token-to-a-string
#define PRODUCT_ELASTOS_VERSION STR(VERSION_MAJOR) "." \
STR(VERSION_MINOR) "." \
STR(VERSION_BUILD) "." \
STR(VERSION_REVISION)
now I want to define a new macro PRODUCT_ELASTOS_VERSION_W using macro PRODUCT_ELASTOS_VERSION, it's value should be L"1.1.0.0". so how can I define this macro? TOWSTRING(PRODUCT_ELASTOS_VERSION) is wrong answer.
And if I want to concatenating string, how should I write? L"v" TOWSTRING(PRODUCT_ELASTOS_VERSION) cann't get wide string L"v1.1.0.0".