This is the mail archive of the
gcc-help@gcc.gnu.org
mailing list for the GCC project.
Problems with macros
- From: Alexander dot Schmid at RSD dot rohde-schwarz dot com
- To: gcc-help at gcc dot gnu dot org
- Date: Wed, 11 Dec 2002 15:07:24 +0100
- Subject: Problems with macros
Hi everybody,
My system configuration: Suse Linux 8.1, gcc 3.2.
I´m porting some Windows stuff to Linux. To provide Unicode support, I use the
_T(x) macro from windows <tchar.h> , which actually puts an 'L' in front of the
text 'x'. The definition sounds like this:
#define _T(x) L ## x
This works just fine when x is a string with quotationmarks or a character, like
_T("hello world") or _T('c'), but now I encountered a problem. When I call
_T(__FILE__), gcc seems just to interpret the _T macro and not the __FILE__
macro, so it leads to an error: "L__FILE__ not known", but the result should be
the actual file name in Unicode (The _T(__FILE__) works in Visual C++, so I
think it´s a gcc problem).
Can anybody tell me why this is and how I can get around this (perhaps a special
compiler flag?), or is there no hope for this problem?
Thanks in advance,
Alex