Original Post
i don''t want to write in each files
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
i wanted to create a macro so that in the beginning of each files i just have to write DEBUG_MEM, but it doesn''t seem to work.
here is my macro :
#define DEBUG_MEM \
#ifdef _DEBUG \
#define new DEBUG_NEW \
#undef THIS_FILE \
static char THIS_FILE[] = __FILE__; \
#endif
and here is the error i have when i write DEBUG_NEW
error C2121: ''#'' : invalid character : possibly the result of a macro expansion.