This is the mail archive of the gcc-help@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

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






Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]