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


--- Norman Vine <nhv@cape.com> wrote:
-8<-
> 
> 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   
> 

As Chuck pointed out you should use __CYGWIN__ instead of _WIN32 in this case. 
However, I wouuld remove the outer #if.  Isn't enought to do:

#if defined(MAKEDLL)
#  define INTERFACE __declspec(dllexport)
#elif defined(USEDLL)
#  define INTERFACE __declspec(dllimport)
#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.
> 

The community should be using __CYGWIN__ for preprocessor conditioning for the
Cygwin GCC.  One of the major problems I have with having the _WIN32 macro
defined is that some software already uses the macro to condition for Win32
specific things and that gets in the way of compiling for POSIX.

Cheers,

=====
---
   Earnie Boyd: <mailto:earnie_boyd@yahoo.com>
            __Cygwin: POSIX on Windows__
Cygwin Newbies: <http://www.freeyellow.com/members5/gw32/index.html>
           __Minimalist GNU for Windows__
  Mingw32 List: <http://www.egroups.com/group/mingw32/>
    Mingw Home: <http://www.mingw.org/>

__________________________________________________
Do You Yahoo!?
Get Yahoo! Mail - Free email you can access from anywhere!
http://mail.yahoo.com/

--
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]