Subject: RE: New GCC available for testing (TRY 3) -- fixes -mno-cygwin pr oblem
From: Earnie Boyd <[email-masked]>
To: [email-masked]
Cc: cygwin users <[email-masked]>
Date: Fri, 23 Jun 2000 05:48:19 -0700 (PDT)

--- Norman Vine <[email-masked]> 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:[email-masked]>
            __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 [email-masked]