Mesa (master): glsl: Fix MSVC build (missing strcasecmp())

Paul Berry stereotype441 at kemper.freedesktop.org
Fri Oct 18 01:16:27 UTC 2013


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

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Thu Oct 17 13:47:35 2013 -0700

glsl: Fix MSVC build (missing strcasecmp())

MSVC doesn't have a strcasecmp() function; it uses _stricmp() instead.

Reviewed-by: Jose Fonseca <jfonseca at vmware.com>

---

 src/glsl/glsl_parser.yy |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index ba2dc63..00589e2 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -66,8 +66,14 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
     */
    if (state->es_shader)
       return strcmp(s1, s2);
-   else
+   else {
+#if defined(_MSC_VER)
+      /* MSVC doesn't have a strcasecmp() function; instead it has _stricmp. */
+      return _stricmp(s1, s2);
+#else
       return strcasecmp(s1, s2);
+#endif
+   }
 }
 %}
 




More information about the mesa-commit mailing list