summaryrefslogtreecommitdiffstats
path: root/contrib/libs/curl/lib/memdebug.h
diff options
context:
space:
mode:
authorthegeorg <[email protected]>2024-10-04 11:15:32 +0300
committerthegeorg <[email protected]>2024-10-04 11:29:39 +0300
commit37112f646e6da1c3eb50de15cbbb8793b383b27e (patch)
treef32d6652f26110a47441c8cf8a08216eca1a52b6 /contrib/libs/curl/lib/memdebug.h
parent9a6b8cb5c502ba2b158c337ce13e983e3c3dc78f (diff)
Update contrib/libs/curl to 8.10.1
commit_hash:428ef806a15515cdaa325530aa8cc6903fac5fb6
Diffstat (limited to 'contrib/libs/curl/lib/memdebug.h')
-rw-r--r--contrib/libs/curl/lib/memdebug.h19
1 files changed, 13 insertions, 6 deletions
diff --git a/contrib/libs/curl/lib/memdebug.h b/contrib/libs/curl/lib/memdebug.h
index 78a012580cf..cabadbcc898 100644
--- a/contrib/libs/curl/lib/memdebug.h
+++ b/contrib/libs/curl/lib/memdebug.h
@@ -34,9 +34,9 @@
#include "functypes.h"
#if defined(__GNUC__) && __GNUC__ >= 3
-# define ALLOC_FUNC __attribute__((malloc))
-# define ALLOC_SIZE(s) __attribute__((alloc_size(s)))
-# define ALLOC_SIZE2(n, s) __attribute__((alloc_size(n, s)))
+# define ALLOC_FUNC __attribute__((__malloc__))
+# define ALLOC_SIZE(s) __attribute__((__alloc_size__(s)))
+# define ALLOC_SIZE2(n, s) __attribute__((__alloc_size__(n, s)))
#elif defined(_MSC_VER)
# define ALLOC_FUNC __declspec(restrict)
# define ALLOC_SIZE(s)
@@ -72,7 +72,7 @@ CURL_EXTERN ALLOC_FUNC wchar_t *curl_dbg_wcsdup(const wchar_t *str,
CURL_EXTERN void curl_dbg_memdebug(const char *logname);
CURL_EXTERN void curl_dbg_memlimit(long limit);
-CURL_EXTERN void curl_dbg_log(const char *format, ...);
+CURL_EXTERN void curl_dbg_log(const char *format, ...) CURL_PRINTF(1, 2);
/* file descriptor manipulators */
CURL_EXTERN curl_socket_t curl_dbg_socket(int domain, int type, int protocol,
@@ -114,11 +114,17 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source);
/* Set this symbol on the command-line, recompile all lib-sources */
#undef strdup
#define strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__)
+#undef malloc
#define malloc(size) curl_dbg_malloc(size, __LINE__, __FILE__)
+#undef calloc
#define calloc(nbelem,size) curl_dbg_calloc(nbelem, size, __LINE__, __FILE__)
+#undef realloc
#define realloc(ptr,size) curl_dbg_realloc(ptr, size, __LINE__, __FILE__)
+#undef free
#define free(ptr) curl_dbg_free(ptr, __LINE__, __FILE__)
+#undef send
#define send(a,b,c,d) curl_dbg_send(a,b,c,d, __LINE__, __FILE__)
+#undef recv
#define recv(a,b,c,d) curl_dbg_recv(a,b,c,d, __LINE__, __FILE__)
#ifdef _WIN32
@@ -137,13 +143,14 @@ CURL_EXTERN int curl_dbg_fclose(FILE *file, int line, const char *source);
#undef socket
#define socket(domain,type,protocol)\
- curl_dbg_socket(domain, type, protocol, __LINE__, __FILE__)
+ curl_dbg_socket((int)domain, type, protocol, __LINE__, __FILE__)
#undef accept /* for those with accept as a macro */
#define accept(sock,addr,len)\
curl_dbg_accept(sock, addr, len, __LINE__, __FILE__)
#ifdef HAVE_SOCKETPAIR
#define socketpair(domain,type,protocol,socket_vector)\
- curl_dbg_socketpair(domain, type, protocol, socket_vector, __LINE__, __FILE__)
+ curl_dbg_socketpair((int)domain, type, protocol, socket_vector, \
+ __LINE__, __FILE__)
#endif
#ifdef HAVE_GETADDRINFO