mirror of
https://github.com/curl/curl.git
synced 2026-08-04 06:09:59 +03:00
memdebug: include in unity batch
Before this patch `memdebug.c` was compiled as a separate source in unity builds. This was necessary because `memdebug.c` failed to compile if `memdebug.h` was included before it, in `CURLDEBUG` mode. This patch fixes this issue and allows to compile `memdebug.c` as part of the unity source batch. This removes an exception and makes builds perform a notch better. - introduce `CURL_SCLOSE()` macro as an immutable synonym of `sclose()`. - memdebug: replace `sclose()` reference with `CURL_SCLOSE()` to compile as expected when `sclose()` is overridden by `memdebug.h`. - memdebug: make it not break when including `memdebug.h` before it in `CURLDEBUG` mode. Do this by calling low-level functions as `(function)`. - autotools, cmake: drop memdebug exception, include it like any other source file. This is now possible because `memdebug.c` doesn't break if `memdebug.h` was included before it, in `CURLDEBUG` builds. - mk-unity: drop `--exclude` option. No longer used after this patch. - drop `MEMDEBUG_NODEFINES` macro hack. No longer necessary. Ref: #16747 Closes #16746 Closes #16738 Closes #17631
This commit is contained in:
parent
2ac18d7ae4
commit
cde81e4398
7 changed files with 26 additions and 55 deletions
|
|
@ -126,8 +126,6 @@ CURL_EXTERN ALLOC_FUNC
|
|||
|
||||
#endif /* HEADER_CURL_MEMDEBUG_H_EXTERNS */
|
||||
|
||||
#ifndef MEMDEBUG_NODEFINES
|
||||
|
||||
/* Set this symbol on the command-line, recompile all lib-sources */
|
||||
#undef strdup
|
||||
#define strdup(ptr) curl_dbg_strdup(ptr, __LINE__, __FILE__)
|
||||
|
|
@ -187,8 +185,6 @@ CURL_EXTERN ALLOC_FUNC
|
|||
#define fdopen(file,mode) curl_dbg_fdopen(file,mode,__LINE__,__FILE__)
|
||||
#define fclose(file) curl_dbg_fclose(file,__LINE__,__FILE__)
|
||||
|
||||
#endif /* MEMDEBUG_NODEFINES */
|
||||
|
||||
#endif /* CURLDEBUG */
|
||||
|
||||
/*
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue