mirror of
https://github.com/curl/curl.git
synced 2026-05-30 06:57:28 +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
|
|
@ -31,14 +31,11 @@ use strict;
|
|||
use warnings;
|
||||
|
||||
if(!@ARGV) {
|
||||
die "Usage: $0 [--test <tests>] [--include <include-c-sources>] [--exclude <exclude-c-sources>] [--srcdir <srcdir>] [--embed]\n";
|
||||
die "Usage: $0 [--test <tests>] [--include <include-c-sources>] [--srcdir <srcdir>] [--embed]\n";
|
||||
}
|
||||
|
||||
# Specific sources to exclude or add as an extra source file
|
||||
my @src;
|
||||
my %exclude;
|
||||
my %include;
|
||||
my $in_exclude = 0;
|
||||
my $in_include = 0;
|
||||
my $srcdir = "";
|
||||
my $in_srcdir = 0;
|
||||
|
|
@ -46,15 +43,9 @@ my $any_test = 0;
|
|||
my $embed = 0;
|
||||
foreach my $src (@ARGV) {
|
||||
if($src eq "--test") {
|
||||
$in_exclude = 0;
|
||||
$in_include = 0;
|
||||
}
|
||||
elsif($src eq "--exclude") {
|
||||
$in_exclude = 1;
|
||||
$in_include = 0;
|
||||
}
|
||||
elsif($src eq "--include") {
|
||||
$in_exclude = 0;
|
||||
$in_include = 1;
|
||||
}
|
||||
elsif($src eq "--embed") {
|
||||
|
|
@ -67,9 +58,6 @@ foreach my $src (@ARGV) {
|
|||
$srcdir = $src;
|
||||
$in_srcdir = 0;
|
||||
}
|
||||
elsif($in_exclude) {
|
||||
$exclude{$src} = 1;
|
||||
}
|
||||
elsif($in_include) {
|
||||
$include{$src} = 1;
|
||||
push @src, $src;
|
||||
|
|
@ -88,7 +76,7 @@ if($any_test) {
|
|||
my $tlist = "";
|
||||
|
||||
foreach my $src (@src) {
|
||||
if($src =~ /([a-z0-9]+)\.c$/ && !exists $exclude{$src}) {
|
||||
if($src =~ /([a-z0-9]+)\.c$/) {
|
||||
my $name = $1;
|
||||
if($embed) {
|
||||
my $fn = $src;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue