🚀 go-pugleaf

RetroBBS NetNews Server

Inspired by RockSolid Light RIP Retro Guy

2 total messages Started by ALLEN Fri, 09 Feb 1990 18:47
predefined macros
#499
Author: ALLEN
Date: Fri, 09 Feb 1990 18:47
10 lines
769 bytes
I want to use the same header file for both c and c++, so
with cfront 1.2 I did "#ifdef c_plusplus".  I am using g++-1.36.4
based on gcc-1.36.94, which defines __GNUG__, but not c_plusplus.
Is there a better sol'n than cheking for __GNUG__ and putting
off the problem of a different c++ compiler till I actually
have a different c++ compiler?

Thanks,
allen@sscvx1.ssc.gov
Michael Allen
Re: predefined macros
#501
Author: Ronald Guilmette
Date: Sat, 10 Feb 1990 09:35
17 lines
1062 bytes
In article <900209124736.20205279@SSCVX1.SSC.GOV> ALLEN@SSCVX1.SSC.GOV writes:
>I want to use the same header file for both c and c++, so
>with cfront 1.2 I did "#ifdef c_plusplus".  I am using g++-1.36.4
>based on gcc-1.36.94, which defines __GNUG__, but not c_plusplus.
>Is there a better sol'n than cheking for __GNUG__ and putting
>off the problem of a different c++ compiler till I actually
>have a different c++ compiler?

What's wrong with:

	#if defined(c_plusplus) || defined(__GNUG__)

Actually, the "right" way to do this nowadays is:

	#if defined (__cplusplus)

// rfg
Thread Navigation

This is a paginated view of messages in the thread with full content displayed inline.

Messages are displayed in chronological order, with the original post highlighted in green.

Use pagination controls to navigate through all messages in large threads.

Back to All Threads