gcc -U_WIN32 pitfalls!

Anders Norlander anorland@hem2.passagen.se
Sat Apr 24 01:29:00 GMT 1999


Mumit Khan wrote:
> 
> Just for kicks, I tried to build a small analysis program with -U_WIN32;
> this tool is essentially a filter and doesn't use any win32 specific
> features, so it should be pretty safe, right?
> 
> Looks like certain typedefs are *WRONG* when you undefine _WIN32 and it
> causes amazingly subtle bugs! Any code using stat for example will be
> subtly but surely broken.

Here's the line at the top of sys/types.h causing these bugs:
#if defined (GO32) || defined (__MSDOS__) || defined (_WIN32)

it should be:
#if defined (GO32) || defined (__MSDOS__) || defined (_WIN32) ||
defined(__CYGWIN__)

I don't think there are more of these bugs, a grep for _WIN32
didn't reveal anything.

Regards,
Anders

--
Want to unsubscribe from this list?
Send a message to cygwin-unsubscribe@sourceware.cygnus.com



More information about the Cygwin mailing list