V3 PATCH: #undef some C99 math macros in <cmath>
Benjamin Kosnik
bkoz@redhat.com
Thu Apr 5 19:40:00 GMT 2001
> | > > + #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.
Ok. I stand corrected.
I didn't mean _USE_GNU, I meant this:
#define _GNU_SOURCE 1
this is unconditionally defined in config/os/gnu-linux/bits/os_defines.h
Obviously, this is not such a smooth idea, as it leads to the problems
that you are experiencing.
> Where should we put those? In the global namespace or in the std::?
> Strictly speaking, we're not allowed to put them in the global
> namespace.
Ugh. I think conditionally putting them into std:: makes the most sense,
as eventually they will wind up there, correct? Then if users enable c99
support, they could have access to these functions.
-benjamin
More information about the Libstdc++
mailing list