]> git.ipfire.org Git - thirdparty/freeswitch.git/commitdiff
Silence warnings: Use _strdup instead of strdup on Windows Release build
authorPeter Olsson <peter@olssononline.se>
Tue, 14 Jan 2014 08:47:36 +0000 (09:47 +0100)
committerPeter Olsson <peter@olssononline.se>
Tue, 14 Jan 2014 08:49:08 +0000 (09:49 +0100)
src/include/switch_utils.h

index 971a915badf63e45d87707328ff9ab8a97232ef9..54e0d369adabb503fd7d404dc13dcbd0bf3198f7 100644 (file)
@@ -1019,7 +1019,11 @@ SWITCH_DECLARE(int) switch_split_user_domain(char *in, char **user, char **domai
 #ifdef NDEBUG
 #define switch_malloc(ptr, len) (void)( (!!(ptr = malloc(len))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr )
 #define switch_zmalloc(ptr, len) (void)( (!!(ptr = calloc(1, (len)))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr)
+#if (_MSC_VER >= 1500)                 // VC9+
+#define switch_strdup(ptr, s) (void)( (!!(ptr = _strdup(s))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr)
+#else
 #define switch_strdup(ptr, s) (void)( (!!(ptr = strdup(s))) || (fprintf(stderr,"ABORT! Malloc failure at: %s:%d", __FILE__, __LINE__),abort(), 0), ptr)
+#endif
 #else
 #if (_MSC_VER >= 1500)                 // VC9+
 #define switch_malloc(ptr, len) (void)(assert(((ptr) = malloc((len)))),ptr);__analysis_assume( ptr )