This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: V3 PATCH: #undef some C99 math macros in <cmath>
- To: Benjamin Kosnik <bkoz at redhat dot com>
- Subject: Re: V3 PATCH: #undef some C99 math macros in <cmath>
- From: Ulrich Drepper <drepper at redhat dot com>
- Date: 05 Apr 2001 19:18:19 -0700
- Cc: Gabriel Dos Reis <Gabriel dot Dos-Reis at cmla dot ens-cachan dot fr>, gcc-patches at gcc dot gnu dot org, libstdc++ at gcc dot gnu dot org
- References: <Pine.SOL.3.91.1010405185653.28675B-100000@cse.cygnus.com>
- Reply-To: drepper at cygnus dot com (Ulrich Drepper)
Benjamin Kosnik <bkoz@redhat.com> writes:
> a better way to do this would be to disable _USE_GNU so that math.h
> doesn't define the C99 stuff at all.
You never must touch the __USE_* macros, this can have very strange
effects. And the C99 stuff is not only defined if __USE_GNU is
defined.
> > + #undef fpclassify
> > + #undef isfinite
> > + #undef isinf
> > + #undef isnan
> > + #undef isnormal
> > + #undef signbit
> > +
> > + #undef isgreater
> > + #undef isgreaterequal
> > + #undef isless
> > + #undef islessequal
> > + #undef islessgreater
> > + #undef isunordered
>
> in the short term, this is acceptable.
This is what you always will have to do. C99 demands that these are
macros. You'll replace them with template functions after undefining
the macros. There is not more correct way.
--
---------------. ,-. 1325 Chesapeake Terrace
Ulrich Drepper \ ,-------------------' \ Sunnyvale, CA 94089 USA
Red Hat `--' drepper at redhat.com `------------------------