summaryrefslogtreecommitdiffstats
path: root/include/c99_math.h
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2016-02-11 15:09:30 -0800
committerJason Ekstrand <[email protected]>2016-02-11 15:09:30 -0800
commitff8895ba5606372f368917b97b8c4380bb822234 (patch)
tree4f4387c154e1988e1005237187ba1bee661b5bd7 /include/c99_math.h
parent2009e304f7c0bdf5bf01b8dd60dddc2f8bb25f18 (diff)
parent9f8c01b03c168f6cf7aa12046be73e0fc46940c6 (diff)
Merge remote-tracking branch 'mesa-public/master' into vulkan
Diffstat (limited to 'include/c99_math.h')
-rw-r--r--include/c99_math.h49
1 files changed, 5 insertions, 44 deletions
diff --git a/include/c99_math.h b/include/c99_math.h
index 8a67fb133d6..250e08d44cf 100644
--- a/include/c99_math.h
+++ b/include/c99_math.h
@@ -38,55 +38,16 @@
#include "c99_compat.h"
-#if defined(_MSC_VER)
-
/* This is to ensure that we get M_PI, etc. definitions */
-#if !defined(_USE_MATH_DEFINES)
+#if defined(_MSC_VER) && !defined(_USE_MATH_DEFINES)
#error _USE_MATH_DEFINES define required when building with MSVC
#endif
-#if _MSC_VER < 1800
-#define isfinite(x) _finite((double)(x))
-#define isnan(x) _isnan((double)(x))
-#endif /* _MSC_VER < 1800 */
-
-#if _MSC_VER < 1800
-static inline double log2( double x )
-{
- const double invln2 = 1.442695041;
- return log( x ) * invln2;
-}
-
-static inline double
-round(double x)
-{
- return x >= 0.0 ? floor(x + 0.5) : ceil(x - 0.5);
-}
-
-static inline float
-roundf(float x)
-{
- return x >= 0.0f ? floorf(x + 0.5f) : ceilf(x - 0.5f);
-}
-#endif
-
-#ifndef INFINITY
-#include <float.h> // DBL_MAX
-#define INFINITY (DBL_MAX + DBL_MAX)
-#endif
-
-#ifndef NAN
-#define NAN (INFINITY - INFINITY)
-#endif
-
-#endif /* _MSC_VER */
-
-#if (defined(_MSC_VER) && _MSC_VER < 1800) || \
- (!defined(_MSC_VER) && \
- __STDC_VERSION__ < 199901L && \
- (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) && \
- !defined(__cplusplus))
+#if !defined(_MSC_VER) && \
+ __STDC_VERSION__ < 199901L && \
+ (!defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600) && \
+ !defined(__cplusplus)
static inline long int
lrint(double d)