delorie.com/archives/browse.cgi   search  
Mail Archives: cygwin/2005/08/14/03:28:40

Mailing-List: contact cygwin-help AT cygwin DOT com; run by ezmlm
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
Message-ID: <000901c5a0a1$c4a677f0$cf34000a@sven>
From: "Angel Tsankov" <fn42551 AT fmi DOT uni-sofia DOT bg>
To: "cygwin mailing list" <cygwin AT cygwin DOT com>
References: <000b01c5a032$3dabb7c0$cf34000a AT sven> <42FE9575 DOT 1060804 AT familiehaase DOT de> <42FEE8D7 DOT 9060700 AT softhome DOT net>
Subject: Re: g++ defines for win32
Date: Sun, 14 Aug 2005 10:28:25 +0300
MIME-Version: 1.0
X-IsSubscribed: yes

It seems I've come upon an interesting issue, probably a bug. Here it 
is:
I have a header file that defines __stdcall, __fastdecl and __cdecl. 
If the preprocessor uses the CPLUS_INCLUDE_PATH to find that header 
file, then it does not issue a warning saying that any of the above 
identifiers has been redefined. If, however, it does not use that 
environment variable, then it DOES issue the warning.

Angel Tsankov
fn42551 AT fmi DOT uni-sofia DOT bg

----- Original Message ----- 
From: "Chan Kar Heng" <karheng AT softhome DOT net>
To: "cygwin mailing list" <cygwin AT cygwin DOT com>
Sent: Sunday, August 14, 2005 9:46 AM
Subject: Re: g++ defines for win32


> another way:
>
> echo "#include <stdio.h>" | gcc -dM -E -
>
> ... but this only shows macros defined for the current target 
> platform unlike -dumpspecs which shows everything.
> (in the above, the include file used could be removed, or other 
> files could be specified instead).
>
> rgds,
>
> kh
>
> Gerrit P. Haase wrote:
>> Angel Tsankov wrote:
>>
>>> I downloaded g++ from cygwin and installed it. I noticed that it 
>>> has built-in definitions of __stdcall, __cdecl and __fastcall. 
>>> I've come across other g++ builds for Windows that do not have 
>>> definitions for these identifiers, so I had to filter them out 
>>> from my source code with the help of macros. Now I need to know 
>>> how to distinguish this build of g++ from others in order to not 
>>> filter the above identifiers out.
>>> Here's what I have now:
>>>
>>> #if !(defined (_MSC_VER) || (defined (__GNUC__) && defined 
>>> (__WIN32__)))
>>> #define __cdecl
>>> #define __stdcall
>>> #define __fastcall
>>> #endif
>>
>>
>> gcc -dumpspecs:
>>
>>
>> *cpp:
>> %(cpp_cpu) %{posix:-D_POSIX_SOURCE}   %{mno-win32:%{mno-cygwin: 
>> %emno-cygwin and mno-win32 are not compatible}} 
>> %{mno-cygwin:-D__MSVCRT__ -D__MINGW32__ %{!ansi:%{mthreads:-D_MT}}} 
>> %{!mno-cygwin:-D__CYGWIN32__ -D__CYGWIN__ 
>> %{!ansi:-Dunix} -D__unix__ -D__unix } 
>>  %{mwin32|mno-cygwin:-DWIN32 -D_WIN32 -D__WIN32 -D__WIN32__ 
>> %{!ansi:-DWINNT}}  %{!nostdinc:%{!mno-win32|mno-cygwin:-idirafter 
>> ../include/w32api%s -idirafter ../../include/w32api%s}}
>>
>>
>> For Cygwin (= -mno-win32 = default):
>> __CYGWIN32__
>> __CYGWIN__
>> __unix
>> __unix__
>> unix
>>
>> For MinGW (= -mno-cygwin):
>> __MINGW32__
>> __MSVCRT__
>> WIN32
>> _WIN32
>> __WIN32
>> __WIN32__
>>
>> For Cygwin (+ -mwin32):
>> __CYGWIN32__
>> __CYGWIN__
>> WIN32
>> _WIN32
>> __WIN32
>> __WIN32__
>>
>>
>>
>> Gerrit
>
> --
> 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/
>
> 


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