summaryrefslogtreecommitdiffstats
path: root/include/c99_math.h
diff options
context:
space:
mode:
authorJose Fonseca <[email protected]>2016-02-11 11:36:17 +0000
committerJose Fonseca <[email protected]>2016-02-11 21:36:00 +0000
commit0d4898ae8068d3984242775a6fcc87f280c0ac5a (patch)
tree437d80d6f310eb47eb216d8d15b97c864a3cd993 /include/c99_math.h
parenta97a955b92f39d10c092490b3bf5a9fcbc8e2d57 (diff)
include,gallium: Remove pre-MSVC 2013 compatibility.
Reviewed-by: Brian Paul <[email protected]> Reviewed-by: Roland Scheidegger <[email protected]>
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)