Mesa (master): util: add util_strdup() wrapper macro

Brian Paul brianp at kemper.freedesktop.org
Mon Oct 23 21:13:24 UTC 2017


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

Author: Brian Paul <brianp at vmware.com>
Date:   Tue Oct 17 13:57:45 2017 -0600

util: add util_strdup() wrapper macro

To work around MSVC warning that strdup() is a deprecated POSIX function.

Reviewed-by: Nicolai Hähnle <nicolai.haehnle at amd.com>

---

 src/util/u_string.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/src/util/u_string.h b/src/util/u_string.h
index fa0241e542..ce454308d7 100644
--- a/src/util/u_string.h
+++ b/src/util/u_string.h
@@ -203,6 +203,7 @@ util_strstr(const char *haystack, const char *needle)
 
 
 #define util_strcasecmp stricmp
+#define util_strdup _strdup
 
 #else
 
@@ -217,6 +218,7 @@ util_strstr(const char *haystack, const char *needle)
 #define util_strncat strncat
 #define util_strstr strstr
 #define util_strcasecmp strcasecmp
+#define util_strdup strdup
 
 #endif
 




More information about the mesa-commit mailing list