Mesa (master): util/u_math: Fix C++ include of u_math.h on MSVC.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Wed Oct 9 23:32:01 UTC 2013


Module: Mesa
Branch: master
Commit: dbc1f3677c1deb32358a6a53f0ad3638a78c7c4f
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dbc1f3677c1deb32358a6a53f0ad3638a78c7c4f

Author: José Fonseca <jfonseca at vmware.com>
Date:   Mon Oct  7 17:09:46 2013 -0700

util/u_math: Fix C++ include of u_math.h on MSVC.

GNU C++ compiler declares the C99 lrint, etc. when _GNU_SOURCE is
defined, but MSVC does not.

Trivial.

---

 src/gallium/auxiliary/util/u_math.h |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/src/gallium/auxiliary/util/u_math.h b/src/gallium/auxiliary/util/u_math.h
index 478a4aa..3005349 100644
--- a/src/gallium/auxiliary/util/u_math.h
+++ b/src/gallium/auxiliary/util/u_math.h
@@ -162,7 +162,7 @@ float log2f(float f)
 #endif
 
 
-#if __STDC_VERSION__ < 199901L && !defined(__cplusplus)
+#if __STDC_VERSION__ < 199901L && (!defined(__cplusplus) || !defined(_GNU_SOURCE))
 static INLINE long int
 lrint(double d)
 {




More information about the mesa-commit mailing list