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]

#define a phrase to be replaced by a single word


Hi,

I use MinGW (gcc) compiler on Win32.
It allows me to declare the 64-bit integer type 'long long'.

However, if I then try to build the same code using a Microsoft compiler, the compilation fails because 'long long' is deemed illegal. Instead I have to declare the 64-bit integer type as '_int64'.

To make the code portable across both compilers I tried the following preprocessor directives:

#ifdef _MSC_VER
#define long long _int64
#endif

But, of course, that results in 'long' being replaced by 'long _int64'.

How do I make my intention clear to the preprocessor - ie that I want to replace the phrase 'long long' with the single term '_int64' ?

I've looked in books, and in the comp.lang.c FAQ, and I can't find an answer anywhere .... I'm starting to wonder if it can be done at all.

Cheers,
Rob


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