From 1c55ac1c17e297cb292c369a8318220786ce86d7 Mon Sep 17 00:00:00 2001 From: Viktor Szakats Date: Sat, 5 Jul 2025 11:18:20 +0200 Subject: [PATCH] streamline `fake_sclose()` redef flow --- lib/curl_memory.h | 2 -- lib/memdebug.h | 10 ++++++---- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lib/curl_memory.h b/lib/curl_memory.h index 4c1adfdf45..3aa7c51fce 100644 --- a/lib/curl_memory.h +++ b/lib/curl_memory.h @@ -99,8 +99,6 @@ ** Following section applies even when CURLDEBUG is not defined. */ -#undef fake_sclose - #ifndef CURLDEBUG /* diff --git a/lib/memdebug.h b/lib/memdebug.h index 03b04b12dc..e35e7c1c2a 100644 --- a/lib/memdebug.h +++ b/lib/memdebug.h @@ -170,6 +170,7 @@ CURL_EXTERN ALLOC_FUNC #undef sclose #define sclose(sockfd) curl_dbg_sclose(sockfd,__LINE__,__FILE__) +#undef fake_sclose #define fake_sclose(sockfd) curl_dbg_mark_sclose(sockfd,__LINE__,__FILE__) #undef fopen @@ -179,16 +180,17 @@ CURL_EXTERN ALLOC_FUNC #undef fclose #define fclose(file) curl_dbg_fclose(file,__LINE__,__FILE__) +#else + +#undef fake_sclose +#define fake_sclose(x) Curl_nop_stmt + #endif /* CURLDEBUG */ /* ** Following section applies even when CURLDEBUG is not defined. */ -#ifndef fake_sclose -#define fake_sclose(x) Curl_nop_stmt -#endif - /* * Curl_safefree defined as a macro to allow MemoryTracking feature * to log free() calls at same location where Curl_safefree is used.