public inbox for gcc@gcc.gnu.org
 help / color / mirror / Atom feed
* RE: How to distinguish EGCS
@ 1998-10-30 15:21 Jan Reimers
  0 siblings, 0 replies; 4+ messages in thread
From: Jan Reimers @ 1998-10-30 15:21 UTC (permalink / raw)
  To: 'rch@troi.baustatik.rwth-aachen.de'; +Cc: 'egcs@cygnus.com'

> QUESTION:
> 
> Can anyone tell me how to dump the predefined macros? 
> 
bash-2.01$ gcc -v test.cc
Reading specs from
\usr\local\lib\gcc-lib\i586-pc-cygwin32\egcs-2.91.57\specs
gcc version egcs-2.91.57 19980901 (egcs-1.1 release)
 \usr\local\lib\gcc-lib\i586-pc-cygwin32\egcs-2.91.57\cpp.exe -lang-c++
-v -ipre
fix
C:/Cygnus/B19/H-i386-cygwin32/lib/gcc-lib/i586-pc-cygwin32\egcs-2.91.57\
-un
def -D__GNUC__=2 -D__GNUG__=2 -D__cplusplus -D__GNUC_MINOR__=91 -Di386
-D_WIN32
-D__CYGWIN32__ -DWINNT -D_X86_=1 -D__STDC__=1
-D__stdcall=__attribute__((__stdca
ll__)) -D__cdecl=__attribute__((__cdecl__))
-D__declspec(x)=__attribute__((x)) -
D__i386__ -D_WIN32 -D__CYGWIN32__ -D__WINNT__ -D_X86_=1 -D__STDC__=1
-D__stdcall
=__attribute__((__stdcall__)) -D__cdecl=__attribute__((__cdecl__))
-D__declspec(
x)=__attribute__((x)) -D__i386 -D__WINNT -Asystem(winnt) -Acpu(i386)
-Amachine(i
386) -D__EXCEPTIONS -remap -Asystem(unix) -Acpu(i386) -Amachine(i386)
-Di386 -D_
_i386 -D__i386__ -Di586 -Dpentium -D__i586 -D__i586__ -D__pentium
-D__pentium__


> And
> whether there is a special macro identifying the current compiler
> version?
> 
Looks like you want __GNUC_MINOR__

> Lot of Thanks   
> 
> rch
> 
> -- 
> Dr.-Ing. Rostislav Chudoba           
> Institut fuer Baustatik und Baudynamik  
> Fakultaet fuer Bauingeniurwesen, RWTH Aachen
> 
> mail:  rch@baustatik.rwth-aachen.de
> www:   www.sd.bi.ruhr-uni-bochum.de:/global/staff/chudoba (still in
> Bcchum)
> phone: +49 (241) 80-3510
> fax:   +49 (241) 8888-303
> 

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to distinguish EGCS
  1998-10-30  3:25 Rostislav Chudoba
  1998-10-30 13:42 ` Jeffrey A Law
@ 1998-10-30 14:59 ` Zack Weinberg
  1 sibling, 0 replies; 4+ messages in thread
From: Zack Weinberg @ 1998-10-30 14:59 UTC (permalink / raw)
  To: rch; +Cc: egcs

On Fri, 30 Oct 1998 11:45:01 +0100 (CET), Rostislav Chudoba wrote:
>
>When porting a code from gcc 2.7.2 to egcs I need to distinguish the
>version of the compiler to use the appropriate code. I was searching
>for a predefined macro just like __GNUG__ to insert #ifdef #else
>#endif. 
>
>QUESTION:
>
>Can anyone tell me how to dump the predefined macros? And
>whether there is a special macro identifying the current compiler
>version?

You dump predefines like this:

$ gcc -E -dM -xc /dev/null

There are two macros which give the version number, __GNUC__ and
__GNUC_MINOR__.  Test them like this:

#if defined __GNUC__ && (__GNUC__ > 2 || \
			 __GNUC__ == 2 && __GNUC_MINOR__ >= 8)
/* gcc 2.8 or egcs */
#else
/* older gcc, or some other compiler entirely */
#endif

If you need to tell EGCS from gcc-2.8, change the 8 to 90.

zw

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: How to distinguish EGCS
  1998-10-30  3:25 Rostislav Chudoba
@ 1998-10-30 13:42 ` Jeffrey A Law
  1998-10-30 14:59 ` Zack Weinberg
  1 sibling, 0 replies; 4+ messages in thread
From: Jeffrey A Law @ 1998-10-30 13:42 UTC (permalink / raw)
  To: rch; +Cc: egcs

  In message < 13881.38744.364911.4291@troi.baustatik.rwth-aachen.de >you write:
  > 
  > When porting a code from gcc 2.7.2 to egcs I need to distinguish the
  > version of the compiler to use the appropriate code. I was searching
  > for a predefined macro just like __GNUG__ to insert #ifdef #else
  > #endif. 
  > 
  > QUESTION:
  > 
  > Can anyone tell me how to dump the predefined macros? And
  > whether there is a special macro identifying the current compiler
  > version?
Look at the major/minor version number macros.

egcs will have different version #s than gcc2.

jeff

^ permalink raw reply	[flat|nested] 4+ messages in thread

* How to distinguish EGCS
@ 1998-10-30  3:25 Rostislav Chudoba
  1998-10-30 13:42 ` Jeffrey A Law
  1998-10-30 14:59 ` Zack Weinberg
  0 siblings, 2 replies; 4+ messages in thread
From: Rostislav Chudoba @ 1998-10-30  3:25 UTC (permalink / raw)
  To: egcs

When porting a code from gcc 2.7.2 to egcs I need to distinguish the
version of the compiler to use the appropriate code. I was searching
for a predefined macro just like __GNUG__ to insert #ifdef #else
#endif. 

QUESTION:

Can anyone tell me how to dump the predefined macros? And
whether there is a special macro identifying the current compiler
version?

Lot of Thanks   

rch

-- 
Dr.-Ing. Rostislav Chudoba           
Institut fuer Baustatik und Baudynamik  
Fakultaet fuer Bauingeniurwesen, RWTH Aachen

mail:  rch@baustatik.rwth-aachen.de
www:   www.sd.bi.ruhr-uni-bochum.de:/global/staff/chudoba (still in Bcchum)
phone: +49 (241) 80-3510
fax:   +49 (241) 8888-303

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~1998-10-30 15:21 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1998-10-30 15:21 How to distinguish EGCS Jan Reimers
  -- strict thread matches above, loose matches on Subject: below --
1998-10-30  3:25 Rostislav Chudoba
1998-10-30 13:42 ` Jeffrey A Law
1998-10-30 14:59 ` Zack Weinberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).