<div dir="ltr">Pushed. Thanks.<br></div><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jan 23, 2015 at 8:57 AM, Felix Janda <span dir="ltr"><<a href="mailto:felix.janda@posteo.de" target="_blank">felix.janda@posteo.de</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Fixes compilation with musl libc.<br>
<br>
Reviewed-by: Ian Romanick <<a href="mailto:ian.d.romanick@intel.com">ian.d.romanick@intel.com</a>><br>
---<br>
Changes in v2: Add comment by Ian Romanick on fpclassify in C99<br>
---<br>
src/mesa/main/querymatrix.c | 18 +++++++-----------<br>
1 file changed, 7 insertions(+), 11 deletions(-)<br>
<br>
diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c<br>
index eb36c76..ef85175 100644<br>
--- a/src/mesa/main/querymatrix.c<br>
+++ b/src/mesa/main/querymatrix.c<br>
@@ -37,8 +37,12 @@<br>
#define INT_TO_FIXED(x) ((GLfixed) ((x) << 16))<br>
#define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0))<br>
<br>
-#if defined(_MSC_VER)<br>
-#if _MSC_VER < 1800 /* Not required on VS2013 and above. */<br>
+#if defined(fpclassify)<br>
+/* ISO C99 says that fpclassify is a macro. Assume that any implementation<br>
+ * of fpclassify, whether it's in a C99 compiler or not, will be a macro.<br>
+ */<br>
+#elif defined(_MSC_VER)<br>
+/* Not required on VS2013 and above. */<br>
/* Oddly, the fpclassify() function doesn't exist in such a form<br>
* on MSVC. This is an implementation using slightly different<br>
* lower-level Windows functions.<br>
@@ -71,16 +75,8 @@ fpclassify(double x)<br>
return FP_NAN;<br>
}<br>
}<br>
-#endif /* _MSC_VER < 1800 */<br>
-<br>
-#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \<br>
- defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \<br>
- (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \<br>
- (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__)<br>
-<br>
-/* fpclassify is available. */<br>
<br>
-#elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600<br>
+#else<br>
<br>
enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL}<br>
fpclassify(double x)<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.0.5<br>
_______________________________________________<br>
mesa-dev mailing list<br>
<a href="mailto:mesa-dev@lists.freedesktop.org">mesa-dev@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/mesa-dev" target="_blank">http://lists.freedesktop.org/mailman/listinfo/mesa-dev</a><br>
</font></span></blockquote></div><br></div>