aboutsummaryrefslogtreecommitdiff
path: root/lib/memdebug.h
diff options
context:
space:
mode:
authorYang Tse <yangsita@gmail.com>2013-07-19 06:44:46 +0200
committerYang Tse <yangsita@gmail.com>2013-07-19 12:33:10 +0200
commit6bcacff1a52df5818c2a12807de6e7ca896da508 (patch)
tree9b32191db1fdcf2f3a78df13b4c3ee732b51b088 /lib/memdebug.h
parent12d01cb6fa914519d1ced0223cd9ff96a2634de9 (diff)
WIN32 MemoryTracking: require UNICODE for wide strdup code support
Diffstat (limited to 'lib/memdebug.h')
-rw-r--r--lib/memdebug.h13
1 files changed, 7 insertions, 6 deletions
diff --git a/lib/memdebug.h b/lib/memdebug.h
index 955e8b72b..bd565c8dc 100644
--- a/lib/memdebug.h
+++ b/lib/memdebug.h
@@ -46,7 +46,7 @@ CURL_EXTERN void *curl_dorealloc(void *ptr, size_t size, int line,
const char *source);
CURL_EXTERN void curl_dofree(void *ptr, int line, const char *source);
CURL_EXTERN char *curl_dostrdup(const char *str, int line, const char *source);
-#ifdef WIN32
+#if defined(WIN32) && defined(UNICODE)
CURL_EXTERN wchar_t *curl_dowcsdup(const wchar_t *str, int line,
const char *source);
#endif
@@ -90,14 +90,15 @@ CURL_EXTERN int curl_fclose(FILE *file, int line, const char *source);
#define free(ptr) curl_dofree(ptr, __LINE__, __FILE__)
#ifdef WIN32
-# undef wcsdup
-# define wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
-# undef _wcsdup
-# define _wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
-# undef _tcsdup
# ifdef UNICODE
+# undef wcsdup
+# define wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
+# undef _wcsdup
+# define _wcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
+# undef _tcsdup
# define _tcsdup(ptr) curl_dowcsdup(ptr, __LINE__, __FILE__)
# else
+# undef _tcsdup
# define _tcsdup(ptr) curl_dostrdup(ptr, __LINE__, __FILE__)
# endif
#endif