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 wrote:
> 

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

Why not:

#if defined(__CYGWIN__)
  #if defined(MAKEDLL) ...
etc.

__CYGWIN__ implies WIN32, but WIN32 does not always imply cygwin. The
build rules for making dlls will be different for 'typical' Win32 (e.g.
MSVC or Borland, or mingw-gcc & cygwin-gcc -mno-cygwin)  and cygwin
(gcc). The former category should use WIN32 (or __MINGW__ etc); the
latter ought to use __CYGWIN__.

--Chuck

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