Hi Csaba,

Thanks for the reply... yes, it was a long _LOT_ of fun ;=))

> ...consider using platform macros (such as _WIN32) instead of
> compiler macros (_MSC_VER) where appropriate. That would make it
> possible to compile on windows with other compilers (think mingw).

While I absolutely agree with trying to support other compilers, I do
not think the macro _WIN32 is correct here. It is my understanding that
'_WIN32' is in fact defined inside the MS compiler, like _MSC_VER,
__TIME__, etc... that is it is a Predefined Macro, or so the MSDN help
indicates...

And it is true _ALL_ MSVC projects created add /D "WIN32" automatically
to the compiler line of the project files... and if <windows.h> is
included, which sucks in about another 70 includes, one of which is
<windef.h>, it has :-
#ifndef WIN32
#define WIN32
#endif

So while using the macro WIN32, meaning NOT unix, might be appropriate
for MINGW, but not _WIN32 unless the Mingw compiler also has this
predefine, it is also my understanding that this may mess with CYGWIN
building, but not sure on this... Maybe someone who uses and understands
the cygwin environment could comment on this.

Specifically for MINGW support what I see in most in cross platform
sources is :-
#if (defined(_MSC_VER) || defined(__MINGW32__))

Or as in say the boost library -
#if defined(_MSC_VER) || defined(__MWERKS__) || defined(__MINGW32__) ||
defined(__BORLANDC__)

And to that list you could add
#if defined( __CYGWIN__ ) || defined( __CYGWIN32__ )
where appropriate...

All we seek is a 'switch' that says it is _NOT_ *nix, so we could also
go in reverse, like -
#if !(defined(__GNUC__) || defined(__ICC) || defined(__ECC) ||
defined(__KCC) || defined(sgi) || defined(__sun) || defined(__APPLE__))
and maybe others, but that seems just as bad...

So I think the _MSC_VER is correct, or adding all/part of the above, but
not _WIN32 or WIN32... but what do I know ;=))

Regards,

Geoff.



------------------------------------------------------------------------------
Open Source Business Conference (OSBC), March 24-25, 2009, San Francisco, CA
-OSBC tackles the biggest issue in open source: Open Sourcing the Enterprise
-Strategies to boost innovation and cut costs with open source participation
-Receive a $600 discount off the registration fee with the source code: SFAD
http://p.sf.net/sfu/XcvMzF8H
_______________________________________________
Flightgear-devel mailing list
Flightgear-devel@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/flightgear-devel

Reply via email to