This is the mail archive of the cygwin@sourceware.cygnus.com mailing list for the Cygwin project.


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

RE: New GCC available for testing (TRY 3) -- fixes -mno-cygwin pr oblem


> Earnie Boyd writes:

>> Norman Vine wrote:

>> What is the consensus of opinion as to the 'best' way to 
>> differentiate a 'Cygwin' compile in a header file.
>> 
>> I have been stumbling apon this a lot recently
>> #if defined( _WIN32 ) 
>> 
>> which IMHO breaks Cygwin
>> 
>
>Me too, and that is why I modify the specs file to only define 
>_WIN32 and WINNT
>if the -mno-cygwin switch is specified.

Hadn't thought of doing that - cute :-)

However fine as this is for my local compiles it still doesn't 
help much when trying to write or help maintain cross-platform 
OpenSource libraries where we can not expect the user to be using
anything other then the 'as distributed' toolkit.

Also IMHO it seems as if the _WIN32 define is sometimes useful
for instance when building DLL's 

#if defined(_WIN32)
   #if defined(MAKEDLL)
   #  define INTERFACE __declspec(dllexport)
   #elif defined(USEDLL)
   #  define INTERFACE __declspec(dllimport)
   #else
   #  define INTERFACE
   #endif
#else
#  define INTERFACE
#endif   


I maintain it would be a GOOD THING if we the Cygwin user
community came up with a 'standard way' of doing this.

Regards

Norman Vine


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


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