Mesa (master): glsl: Generalize MSVC fix for strcasecmp().

Paul Berry stereotype441 at kemper.freedesktop.org
Tue Oct 29 18:34:35 UTC 2013


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

Author: Paul Berry <stereotype441 at gmail.com>
Date:   Sat Oct 26 10:25:46 2013 -0700

glsl: Generalize MSVC fix for strcasecmp().

This will let us use strcasecmp() from anywhere inside Mesa without
having to worry about the fact that it doesn't exist in MSVC.

Reviewed-by: Kenneth Graunke <kenneth at whitecape.org>
Reviewed-by: Ian Romanick <ian.d.romanick at intel.com>

---

 src/glsl/glsl_parser.yy |    8 +-------
 src/mesa/main/imports.h |    1 +
 2 files changed, 2 insertions(+), 7 deletions(-)

diff --git a/src/glsl/glsl_parser.yy b/src/glsl/glsl_parser.yy
index 0a0708e..4ed4105 100644
--- a/src/glsl/glsl_parser.yy
+++ b/src/glsl/glsl_parser.yy
@@ -66,14 +66,8 @@ static bool match_layout_qualifier(const char *s1, const char *s2,
     */
    if (state->es_shader)
       return strcmp(s1, s2);
-   else {
-#if defined(_MSC_VER)
-      /* MSVC doesn't have a strcasecmp() function; instead it has _stricmp. */
-      return _stricmp(s1, s2);
-#else
+   else
       return strcasecmp(s1, s2);
-#endif
-   }
 }
 %}
 
diff --git a/src/mesa/main/imports.h b/src/mesa/main/imports.h
index 53e40b4..d79e2a3 100644
--- a/src/mesa/main/imports.h
+++ b/src/mesa/main/imports.h
@@ -141,6 +141,7 @@ static inline float acoshf(float x) { return logf(x + sqrtf(x * x - 1.0f)); }
 static inline float atanhf(float x) { return (logf(1.0f + x) - logf(1.0f - x)) / 2.0f; }
 static inline int isblank(int ch) { return ch == ' ' || ch == '\t'; }
 #define strtoll(p, e, b) _strtoi64(p, e, b)
+#define strcasecmp(s1, s2) _stricmp(s1, s2)
 #endif
 /*@}*/
 




More information about the mesa-commit mailing list