diff options
author | Erik Schnetter <schnetter@gmail.com> | 2013-07-07 13:45:56 -0400 |
---|---|---|
committer | Erik Schnetter <schnetter@gmail.com> | 2013-07-07 13:45:56 -0400 |
commit | a8c9f2c30e02727cf7e12f91e8389bb2d86c76fa (patch) | |
tree | f8d61ede8e1c4891603d0470762c22cd8827c8d5 | |
parent | e847df0d3abdb58681e5a931fd3f945410a4c77a (diff) | |
download | vecmathlib-a8c9f2c30e02727cf7e12f91e8389bb2d86c76fa.zip vecmathlib-a8c9f2c30e02727cf7e12f91e8389bb2d86c76fa.tar.gz |
Ensure that isnan etc. are indeed macros when using C99 math functions
-rw-r--r-- | floattypes.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/floattypes.h b/floattypes.h index c7b55df..9c43a31 100644 --- a/floattypes.h +++ b/floattypes.h @@ -47,6 +47,21 @@ namespace std { // Make some math functions from math.h available in std namespace std { // Capture macros into functions, then undefine the macros +#ifndef isfinite +# error "isfinite is not a macro" +#endif +#ifndef isinf +# error "isinf is not a macro" +#endif +#ifndef isnan +# error "isnan is not a macro" +#endif +#ifndef isnormal +# error "isnormal is not a macro" +#endif +#ifndef signbit +# error "signbit is not a macro" +#endif namespace { template<typename T> int libc_isfinite(T x) { return isfinite(x); } template<typename T> int libc_isinf(T x) { return isinf(x); } |