This is the mail archive of the cygwin@sourceware.cygnus.com
mailing list for the Cygwin project. See the Cygwin
home page for more information.
Re: gcc -U_WIN32 pitfalls!
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