]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
memory: tidy up `_tcsdup()` override
authorViktor Szakats <commit@vsz.me>
Mon, 7 Jul 2025 13:11:53 +0000 (15:11 +0200)
committerViktor Szakats <commit@vsz.me>
Mon, 7 Jul 2025 13:32:15 +0000 (15:32 +0200)
Follow-up to ef2ccf862f8fbfe5cb86cb716aead57694a95ef5 #17840
Closes #17845

lib/curl_memory.h
lib/memdebug.h

index 41933d6af9815845a5ccdd0385adef287397b39f..d0ea7f7ff7ea03dc49a01551373816b8199d2955 100644 (file)
 #undef recv
 
 #ifdef _WIN32
-#  ifdef UNICODE
-#    undef _tcsdup
-#  else
-#    undef _tcsdup
-#  endif
+#undef _tcsdup
 #endif
 
 #undef socket
@@ -152,14 +148,13 @@ extern curl_wcsdup_callback Curl_cwcsdup;
 #define free(ptr) Curl_cfree(ptr)
 
 #ifdef _WIN32
-#  ifdef UNICODE
-#    undef _tcsdup
-#    define _tcsdup(ptr) Curl_cwcsdup(ptr)
-#  else
-#    undef _tcsdup
-#    define _tcsdup(ptr) Curl_cstrdup(ptr)
-#  endif
+#undef _tcsdup
+#ifdef UNICODE
+#define _tcsdup(ptr) Curl_cwcsdup(ptr)
+#else
+#define _tcsdup(ptr) Curl_cstrdup(ptr)
 #endif
+#endif /* _WIN32 */
 
 #endif /* CURLDEBUG */
 #endif /* HEADER_CURL_MEMORY_H */
index e109e0b20a9100d2ccfc5edcf21eb36fcd6b4cfc..03b04b12dc2f6d3304e359100d91944a60c2196d 100644 (file)
@@ -141,14 +141,13 @@ CURL_EXTERN ALLOC_FUNC
 #define recv(a,b,c,d) curl_dbg_recv(a,b,c,d, __LINE__, __FILE__)
 
 #ifdef _WIN32
-#  ifdef UNICODE
-#    undef _tcsdup
-#    define _tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
-#  else
-#    undef _tcsdup
-#    define _tcsdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__)
-#  endif
+#undef _tcsdup
+#ifdef UNICODE
+#define _tcsdup(ptr) curl_dbg_wcsdup(ptr, __LINE__, __FILE__)
+#else
+#define _tcsdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__)
 #endif
+#endif /* _WIN32 */
 
 #undef socket
 #define socket(domain,type,protocol) \