From: José Fonseca <[email protected]>

When in C++ mode, MSVC defines overloaded versions of standard names
that preserve constness. :-/

http://msdn.microsoft.com/en-us/library/b34ccac3.aspx
---
 tests/util/piglit-util.h | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/tests/util/piglit-util.h b/tests/util/piglit-util.h
index 099075a..af9fb97 100755
--- a/tests/util/piglit-util.h
+++ b/tests/util/piglit-util.h
@@ -211,7 +211,11 @@ strtod_inf(const char *nptr, char **endptr)
 static inline char *
 strchrnul(const char *s, int c)
 {
+#if defined(_MSC_VER) && defined(__cplusplus)
+       char *t = strchr((char *)s, c);
+#else
        char *t = strchr(s, c);
+#endif
 
        return (t == NULL) ? ((char *) s + strlen(s)) : t;
 }
-- 
2.1.0

_______________________________________________
Piglit mailing list
[email protected]
http://lists.freedesktop.org/mailman/listinfo/piglit

Reply via email to