Problems with macros

John Love-Jensen eljay@adobe.com
Wed Dec 11 06:21:00 GMT 2002


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.)



More information about the Gcc-help mailing list