delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2000/06/23/08:49:10

Mailing-List: contact cygwin-help AT sourceware DOT cygnus DOT com; run by ezmlm
List-Subscribe: <mailto:cygwin-subscribe AT sourceware DOT cygnus DOT com>
List-Archive: <http://sourceware.cygnus.com/ml/cygwin/>
List-Post: <mailto:cygwin AT sourceware DOT cygnus DOT com>
List-Help: <mailto:cygwin-help AT sourceware DOT cygnus DOT com>, <http://sourceware.cygnus.com/ml/#faqs>
Sender: cygwin-owner AT sourceware DOT cygnus DOT com
Delivered-To: mailing list cygwin AT sourceware DOT cygnus DOT com
Message-ID: <20000623124819.1588.qmail@web109.yahoomail.com>
Date: Fri, 23 Jun 2000 05:48:19 -0700 (PDT)
From: Earnie Boyd <earnie_boyd AT yahoo DOT com>
Reply-To: earnie_boyd AT yahoo DOT com
Subject: RE: New GCC available for testing (TRY 3) -- fixes -mno-cygwin pr oblem
To: nhv AT cape DOT com
Cc: cygwin users <cygwin AT sourceware DOT cygnus DOT com>
MIME-Version: 1.0

--- Norman Vine <nhv AT cape DOT 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 AT yahoo DOT 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 AT sourceware DOT cygnus DOT com

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019