[Mesa-dev] [PATCH 2/5] util: add util_strdup() wrapper macro
Brian Paul
brianp at vmware.com
Tue Oct 17 21:17:00 UTC 2017
To work around MSVC warning that strdup() is a deprecated POSIX function.
---
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 fa0241e..ce45430 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
--
1.9.1
More information about the mesa-dev
mailing list