delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2007/11/15/04:43:13

X-Recipient: archive-cygwin AT delorie DOT com
X-Spam-Check-By: sourceware.org
From: Sean Seefried <sean DOT seefried AT nicta DOT com DOT au>
To: dave DOT korn AT artimi DOT com, cygwin AT cygwin DOT com
Date: Thu, 15 Nov 2007 20:42:38 +1100
Message-Id: <00048651-54EE-44D7-8D44-5D34AE3F8ED2@nicta.com.au>
Mime-Version: 1.0 (Apple Message framework v912)
Subject: RE: Request for information on the __INSIDE_CYGWIN__ #define
X-Mailer: Apple Mail (2.912)
Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
List-Id: <cygwin.cygwin.com>
List-Subscribe: <mailto:cygwin-subscribe AT cygwin DOT com>
List-Archive: <http://sourceware.org/ml/cygwin/>
List-Post: <mailto:cygwin AT cygwin DOT com>
List-Help: <mailto:cygwin-help AT cygwin DOT com>, <http://sourceware.org/ml/#faqs>
Sender: cygwin-owner AT cygwin DOT com
Mail-Followup-To: cygwin AT cygwin DOT com
Delivered-To: mailing list cygwin AT cygwin DOT com

> On 15 November 2007 08:38, Sean Seefried wrote:
> > My question centers around the __INSIDE_CYGWIN__ #define.
> > However, try as I might, I simply cannot find a single place where  
> it
> > is defined.
> > a) How does this symbol get #defined?
> It is defined when building the cygwin dll from source, and the  
> definitions it protects should only be used by the cygwin1 dll; they  
> will not make sense in the cygwin posix environment itself. cheers,  
> DaveK -- Can't think of a witty .sigline today....

Thanks Dave for that timely reply, but I'm still confused.  Here is a  
snippet from one of the header files: cygwin/config.h
#if defined(__INSIDE_CYGWIN__) || defined(_COMPILING_NEWLIB)
#define __IMPORT
#else
#define __IMPORT __declspec(dllimport)
#endif

The expression "__declspec(dllimport)" is a Microsoft extension and  
this is included precisely when __INSIDE_CYGWIN__ is *not* defined.   
Since I assume Cygwin is built using Visual C++ and  
__declspec(dllimport) is only accepted by this compiler I assume you  
have to have it undefined when compiling. Or is there something  
fundamental I'm missing here?
If I'm right (and I know I'm probably wrong) then __INSIDE_CYGWIN__  
would have to be defined when compiling things with gcc.  Where is it  
defined though?
Also, I'm not subscribed to this list. Do you think you could CC me  
when you reply?
Cheers,
Sean

--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Problem reports:       http://cygwin.com/problems.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/

- Raw text -


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