This is the mail archive of the
cygwin
mailing list for the Cygwin project.
Re: Request for information on the __INSIDE_CYGWIN__ #define
- From: Brian Dessent <brian at dessent dot net>
- To: Sean Seefried <sean dot seefried at nicta dot com dot au>
- Cc: cygwin at cygwin dot com
- Date: Thu, 15 Nov 2007 02:05:02 -0800
- Subject: Re: Request for information on the __INSIDE_CYGWIN__ #define
- References: <00048651-54EE-44D7-8D44-5D34AE3F8ED2@nicta.com.au>
- Reply-to: cygwin at cygwin dot com
Sean Seefried wrote:
> 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?
dllimport and dllexport are fully supported by gcc, they are not
specific to VC++. It would be impossible for gcc to be a functioning
windows compiler if it did not support them. And Cygwin is most
certainly not built with any MS tools.
The reason for the #ifdef is that these headers are included inside
Cygwin itself. In other words, you can't dllimport a symbol that's in
the same module, you can only dllimport from other external modules.
> 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?
It's only defined when compiling Cygwin itself (in winsup.h), *not* when
generally using gcc.
Brian
--
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/