autoconf
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: can autoconf determine if a preprocessor macro is defined or not?


From: Keith MARSHALL
Subject: Re: can autoconf determine if a preprocessor macro is defined or not?
Date: Fri, 28 Jul 2006 12:54:14 +0100

Ed Hartnett wrote, quoting Bob Friesenhahn:
>>> /* These are needed on mingw to get a dll to compile. They really
>>> * should be provided in sys/stats.h, but what the heck. Let's not be
>>> * too picky! */
>>> #ifndef S_IRGRP
>>> #define S_IRGRP   0000040
>>> #endif
>>> #ifndef S_IROTH
>>> #define S_IROTH   0000004
>>> #endif
>>> #ifndef S_IWGRP
>>> #define S_IWGRP   0000020
>>> #endif
>>> #ifndef S_IWOTH
>>> #define S_IWOTH   0000002
>>> #endif
>>
>> As Keith says, these make no sense for Windows.  Since these values
>> are usually ORed, a simple solution is to use code as you show above
>> but define them all to have the value zero.  This allows existing Unix
>> code to compile without being hacked up.
>
> Thanks, I will do as you suggest.

Yeah, you can do that.  By making them all zero, it's probably even
safe -- at least you won't be testing or setting an attribute which
means something entirely different from your intended meaning.

However, IMO that's a lazy hack -- it suggests that you aren't
really thinking about *why* you specified those attributes in the
first place, and what the implications are, when you port your code
to a different OS.  But, it's your code -- abuse it as you wish.

Regards,
Keith.




reply via email to

[Prev in Thread] Current Thread [Next in Thread]