Commit 35648f2e authored by Dan Fandrich's avatar Dan Fandrich
Browse files

curl_memory: make curl_memory.h the second-last header file loaded

This header file must be included after all header files except
memdebug.h, as it does similar memory function redefinitions and can be
similarly affected by conflicting definitions in system or dependent
library headers.
parent ac2827ac
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -27,10 +27,10 @@
#include "urldata.h" /* for the SessionHandle definition */
#include "warnless.h"
#include "curl_base64.h"
#include "curl_memory.h"
#include "non-ascii.h"

/* include memdebug.h last */
/* The last #include files should be: */
#include "curl_memory.h"
#include "memdebug.h"

/* ---- Base64 Encoding/Decoding Table --- */
+2 −2
Original line number Diff line number Diff line
@@ -62,7 +62,6 @@
#include "if2ip.h"
#include "strerror.h"
#include "connect.h"
#include "curl_memory.h"
#include "select.h"
#include "url.h" /* for Curl_safefree() */
#include "multiif.h"
@@ -75,7 +74,8 @@
#include "conncache.h"
#include "multihandle.h"

/* The last #include file should be: */
/* The last #include files should be: */
#include "curl_memory.h"
#include "memdebug.h"

#ifdef __SYMBIAN32__
+2 −2
Original line number Diff line number Diff line
@@ -91,14 +91,14 @@ Example set of cookies:
#include "strtok.h"
#include "sendf.h"
#include "slist.h"
#include "curl_memory.h"
#include "share.h"
#include "strtoofft.h"
#include "rawstr.h"
#include "curl_memrchr.h"
#include "inet_pton.h"

/* The last #include file should be: */
/* The last #include files should be: */
#include "curl_memory.h"
#include "memdebug.h"

static void freecookie(struct Cookie *co)
+3 −0
Original line number Diff line number Diff line
@@ -28,6 +28,9 @@
 * File curl_memory.h must be included by _all_ *.c source files
 * that use memory related functions strdup, malloc, calloc, realloc
 * or free, and given source file is used to build libcurl library.
 * It should be included immediately before memdebug.h as the last files
 * included to avoid undesired interaction with other memory function
 * headers in dependent libraries.
 *
 * There is nearly no exception to above rule. All libcurl source
 * files in 'lib' subdirectory as well as those living deep inside
+2 −2
Original line number Diff line number Diff line
@@ -41,7 +41,6 @@
#include "curl_ntlm_wb.h"
#include "curl_sasl.h"
#include "url.h"
#include "curl_memory.h"
#include "curl_printf.h"

#if defined(USE_NSS)
@@ -50,7 +49,8 @@
#include "curl_sspi.h"
#endif

/* The last #include file should be: */
/* The last #include files should be: */
#include "curl_memory.h"
#include "memdebug.h"

#if DEBUG_ME
Loading