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]

Re: Problems with macros


Hi Alex,

I'm betting that Microsoft is the one that's not quite compliant.

It works if you have a two-stage macro:

g++ -E -c test.cpp
--- test.cpp ---
#define T(x) L ## x
#define R(x) T(x)
R(__FILE__)
--- end-of-file---

Voila!  Twiddle with the macro names as appropriate, and you shouldn't need
to change any of your existing source code.

--Eljay
(I hate macros.)


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