[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: #ifdefs
I have made the change and checked it into CVS.
- Henrik
"David M. Malon" wrote:
>
> Henrik,
>
> We're having a small problem with an #if in gc_const.h. You use the
> following:
>
> #if __SUNPRO_CC < 0x500
> typedef int bool;
> #define true 1
> #define false 0
> #define explicit
> #define mutable
> #define std
> #endif // __SUNPRO_CC < 0x500
>
> If we use the 5.0 compiler in -compat mode for compatibility with 4.x code
> (which the client code seems to be forced to do until all the libraries it
> uses--even the commercial ones--are rebuilt), this check fails to do what we
> need.
>
> From the CC man page:
>
> Value Meaning
>
> -compat=4 Compile for compatibility with C++
> 4.0.1, C++ 4.1, and C++ 4.2 (Sets
> __cplusplus macro to 1.)
>
> -compat=5 Compile with full C++ 5.0 features.
> (Sets __cplusplus macro to
> 199711L.)
>
> This suggests that you could check whether __cplusplus is one rather than
> whether __SUNPRO_CC is less than 0x500, and things would work. I believe
> that this is Sun's recommended strategy.
>
> What do you think?
>
> David
--
_________________________________________
Henrik Nordberg <hnordberg@lbl.gov>
Scientific Data Management Research Group
Lawrence Berkeley National Laboratory
- References:
- #ifdefs
- From: "David M. Malon" <malon@anl.gov>