This is the mail archive of the cygwin@cygwin.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]
Other format: [Raw text]

Re: gcc/Cygwin awareness


> Is there a macro defined in gcc when running under Cygwin as opposed to, 
> say, linux?

Not too sure, All I could find was GCC_VERSION , __GNUC__ and IN_GCC .

> I'd like to code something like
> 
> #ifdef _GCC_UNDER_CYGWIN
> blah blah
> #else
> blah blah
> #endif

You could use this

#if defined(__GNUC__) && defined(__CYGWIN__)
/* do blah on Cygwin under gcc */
blah ();
#else
/* no Cygwin, do fooblah */
fooblah ();
#endif




--
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
Bug reporting:         http://cygwin.com/bugs.html
Documentation:         http://cygwin.com/docs.html
FAQ:                   http://cygwin.com/faq/


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]