From: Daniel Stenberg Date: Mon, 18 Apr 2016 13:04:17 +0000 (+0200) Subject: includes: avoid duplicate memory callback typdefs even harder X-Git-Tag: curl-7_49_0~130 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a9a1d303f5d8d2d2899c5efffe6360bfc09aa50e;p=thirdparty%2Fcurl.git includes: avoid duplicate memory callback typdefs even harder --- diff --git a/include/curl/curl.h b/include/curl/curl.h index 1df5084107..20dd250e8a 100644 --- a/include/curl/curl.h +++ b/include/curl/curl.h @@ -373,6 +373,7 @@ typedef curlioerr (*curl_ioctl_callback)(CURL *handle, int cmd, void *clientp); +#ifndef CURL_DID_MEMORY_FUNC_TYPEDEFS /* * The following typedef's are signatures of malloc, free, realloc, strdup and * calloc respectively. Function pointers of these types can be passed to the @@ -386,6 +387,7 @@ typedef char *(*curl_strdup_callback)(const char *str); typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); #define CURL_DID_MEMORY_FUNC_TYPEDEFS +#endif /* the kind of data that is passed to information_callback*/ typedef enum { diff --git a/lib/curl_memory.h b/lib/curl_memory.h index cbe3b272bb..6f792fffda 100644 --- a/lib/curl_memory.h +++ b/lib/curl_memory.h @@ -95,6 +95,7 @@ typedef void (*curl_free_callback)(void *ptr); typedef void *(*curl_realloc_callback)(void *ptr, size_t size); typedef char *(*curl_strdup_callback)(const char *str); typedef void *(*curl_calloc_callback)(size_t nmemb, size_t size); +#define CURL_DID_MEMORY_FUNC_TYPEDEFS #endif extern curl_malloc_callback Curl_cmalloc;