diff options
author | Daniel Stenberg <daniel@haxx.se> | 2016-03-31 09:08:40 +0200 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2016-04-01 10:07:38 +0200 |
commit | 7218b52c49aeb1452d1fb94b394b3de2da938f17 (patch) | |
tree | 97a0da313c0263ae46c63e3ba3184633fb05738f /lib/curl_memory.h | |
parent | 9a8aef13654ca648e6028d1a2767882e0745b2f4 (diff) | |
download | curl-7218b52c49aeb1452d1fb94b394b3de2da938f17.tar.gz |
curl_memory.h: avoid the curl/curl.h include
Discussed in #743
Diffstat (limited to 'lib/curl_memory.h')
-rw-r--r-- | lib/curl_memory.h | 15 |
1 files changed, 13 insertions, 2 deletions
diff --git a/lib/curl_memory.h b/lib/curl_memory.h index fcd177cd5..637b24d9f 100644 --- a/lib/curl_memory.h +++ b/lib/curl_memory.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2013, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2016, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -83,7 +83,18 @@ #ifndef CURLX_NO_MEMORY_CALLBACKS -#include <curl/curl.h> /* for the callback typedefs */ +/* + * The following memory funciton replacement typedef's are COPIED from + * curl/curl.h and MUST match the originals. We copy them to avoid having to + * include curl/curl.h here. We avoid that include since it includes stdio.h + * and other headers that may get messed up with defines done here. + */ +typedef void *(*curl_malloc_callback)(size_t size); +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); + extern curl_malloc_callback Curl_cmalloc; extern curl_free_callback Curl_cfree; |