mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-09-07 11:58:12 +00:00
wikiheaders: add (disabled) code to check for missing \threadsafety
tags.
Reference Issue #7140.
This commit is contained in:
@@ -1860,6 +1860,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
my @paramsorder = ();
|
my @paramsorder = ();
|
||||||
my $fnsigparams = $headersymsparaminfo{$sym};
|
my $fnsigparams = $headersymsparaminfo{$sym};
|
||||||
my $has_returns = 0;
|
my $has_returns = 0;
|
||||||
|
my $has_threadsafety = 0;
|
||||||
|
|
||||||
while (@doxygenlines) {
|
while (@doxygenlines) {
|
||||||
my $l = shift @doxygenlines;
|
my $l = shift @doxygenlines;
|
||||||
@@ -1998,6 +1999,7 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
}
|
}
|
||||||
$desc =~ s/[\s\n]+\Z//ms;
|
$desc =~ s/[\s\n]+\Z//ms;
|
||||||
$sections{'Thread Safety'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
$sections{'Thread Safety'} = wordwrap(wikify($wikitype, $desc)) . "\n";
|
||||||
|
$has_threadsafety = 1;
|
||||||
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
|
} elsif ($l =~ /\A\\sa\s+(.*)\Z/) {
|
||||||
my $sa = $1;
|
my $sa = $1;
|
||||||
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
$sa =~ s/\(\)\Z//; # Convert "SDL_Func()" to "SDL_Func"
|
||||||
@@ -2014,6 +2016,11 @@ if ($copy_direction == 1) { # --copy-to-headers
|
|||||||
print STDERR "WARNING: Function '$sym' has a non-void return type but no '\\returns' declaration\n";
|
print STDERR "WARNING: Function '$sym' has a non-void return type but no '\\returns' declaration\n";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# !!! FIXME: uncomment this when we're trying to clean this up in the headers.
|
||||||
|
#if (($symtype == 1) && !$has_threadsafety) {
|
||||||
|
# print STDERR "WARNING: Function '$sym' doesn't have a '\\threadsafety' declaration\n";
|
||||||
|
#}
|
||||||
|
|
||||||
# Make sure %params is in the same order as the actual function signature and add C datatypes...
|
# Make sure %params is in the same order as the actual function signature and add C datatypes...
|
||||||
my $params_has_c_datatype = 0;
|
my $params_has_c_datatype = 0;
|
||||||
my @final_params = ();
|
my @final_params = ();
|
||||||
|
Reference in New Issue
Block a user