[Mesa-dev] [PATCH 5/8] c99_math: Don't reimplement lrint and friends on MSVC 2013.

Jose Fonseca jfonseca at vmware.com
Tue Mar 24 14:16:41 PDT 2015


MSVC 2013 declares these functions, both for C and C++ source files.

This was caught with MSVC in analyze mode.
---
 include/c99_math.h | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/include/c99_math.h b/include/c99_math.h
index 5b01d53..ee0dd10 100644
--- a/include/c99_math.h
+++ b/include/c99_math.h
@@ -82,7 +82,8 @@ roundf(float x)
 #endif /* _MSC_VER */
 
 
-#if __STDC_VERSION__ < 199901L && (!defined(__cplusplus) || defined(_MSC_VER))
+#if (defined(_MSC_VER) && _MSC_VER < 1800) || \
+    (!defined(_MSC_VER) && __STDC_VERSION__ < 199901L && !defined(__cplusplus))
 static inline long int
 lrint(double d)
 {
-- 
2.1.0



More information about the mesa-dev mailing list