diff options
Diffstat (limited to 'meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch')
-rw-r--r-- | meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch | 53 |
1 files changed, 53 insertions, 0 deletions
diff --git a/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch b/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch new file mode 100644 index 0000000000..dd7a188a2f --- /dev/null +++ b/meta/recipes-graphics/mesa/mesa/0002-mesa-simplify-detection-of-fpclassify.patch @@ -0,0 +1,53 @@ +From c09606093c6b8e47d7cb6745eff192184eaaae07 Mon Sep 17 00:00:00 2001 +From: Felix Janda <felix.janda@posteo.de> +Date: Fri, 23 Jan 2015 17:57:15 +0100 +Subject: [PATCH 2/2] mesa: simplify detection of fpclassify + +Fixes compilation with musl libc. + +Reviewed-by: Ian Romanick <ian.d.romanick@intel.com> +Upstream-Status: Backport +--- + src/mesa/main/querymatrix.c | 18 +++++++----------- + 1 file changed, 7 insertions(+), 11 deletions(-) + +diff --git a/src/mesa/main/querymatrix.c b/src/mesa/main/querymatrix.c +index eb36c76..ef85175 100644 +--- a/src/mesa/main/querymatrix.c ++++ b/src/mesa/main/querymatrix.c +@@ -37,8 +37,12 @@ + #define INT_TO_FIXED(x) ((GLfixed) ((x) << 16)) + #define FLOAT_TO_FIXED(x) ((GLfixed) ((x) * 65536.0)) + +-#if defined(_MSC_VER) +-#if _MSC_VER < 1800 /* Not required on VS2013 and above. */ ++#if defined(fpclassify) ++/* ISO C99 says that fpclassify is a macro. Assume that any implementation ++ * of fpclassify, whether it's in a C99 compiler or not, will be a macro. ++ */ ++#elif defined(_MSC_VER) ++/* Not required on VS2013 and above. */ + /* Oddly, the fpclassify() function doesn't exist in such a form + * on MSVC. This is an implementation using slightly different + * lower-level Windows functions. +@@ -71,16 +75,8 @@ fpclassify(double x) + return FP_NAN; + } + } +-#endif /* _MSC_VER < 1800 */ +- +-#elif defined(__APPLE__) || defined(__CYGWIN__) || defined(__FreeBSD__) || \ +- defined(__OpenBSD__) || defined(__NetBSD__) || defined(__DragonFly__) || \ +- (defined(__sun) && defined(__C99FEATURES__)) || defined(__MINGW32__) || \ +- (defined(__sun) && defined(__GNUC__)) || defined(ANDROID) || defined(__HAIKU__) +- +-/* fpclassify is available. */ + +-#elif !defined(_XOPEN_SOURCE) || _XOPEN_SOURCE < 600 ++#else + + enum {FP_NAN, FP_INFINITE, FP_ZERO, FP_SUBNORMAL, FP_NORMAL} + fpclassify(double x) +-- +2.1.4 + |