wikiheaders: fixed to work with not-SDL3 projects.
(SDL2 still uses DECLSPEC, not SDL_DECLSPEC.)
This commit is contained in:
@@ -768,7 +768,7 @@ while (my $d = readdir(DH)) {
|
|||||||
#print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
|
#print("CATEGORY FOR '$dent' CHANGED TO " . (defined($current_wiki_category) ? "'$current_wiki_category'" : '(undef)') . "\n");
|
||||||
push @contents, $_;
|
push @contents, $_;
|
||||||
next;
|
next;
|
||||||
} elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) { # a function declaration without a doxygen comment?
|
} elsif (/\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) { # a function declaration without a doxygen comment?
|
||||||
$symtype = 1; # function declaration
|
$symtype = 1; # function declaration
|
||||||
@templines = ();
|
@templines = ();
|
||||||
$decl = $_;
|
$decl = $_;
|
||||||
@@ -841,7 +841,7 @@ while (my $d = readdir(DH)) {
|
|||||||
$lineno++ if defined $decl;
|
$lineno++ if defined $decl;
|
||||||
$decl = '' if not defined $decl;
|
$decl = '' if not defined $decl;
|
||||||
chomp($decl);
|
chomp($decl);
|
||||||
if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC/) {
|
if ($decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC/) {
|
||||||
$symtype = 1; # function declaration
|
$symtype = 1; # function declaration
|
||||||
} elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
|
} elsif ($decl =~ /\A\s*SDL_FORCE_INLINE/) {
|
||||||
$symtype = 1; # (forced-inline) function declaration
|
$symtype = 1; # (forced-inline) function declaration
|
||||||
@@ -917,7 +917,7 @@ while (my $d = readdir(DH)) {
|
|||||||
|
|
||||||
my $paramsstr = undef;
|
my $paramsstr = undef;
|
||||||
|
|
||||||
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
|
if (!$is_forced_inline && $decl =~ /\A\s*extern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\s+(const\s+|)(unsigned\s+|)(.*?)([\*\s]+)(\*?)\s*SDLCALL\s+(.*?)\s*\((.*?)\);/) {
|
||||||
$sym = $8;
|
$sym = $8;
|
||||||
$rettype = "$3$4$5$6";
|
$rettype = "$3$4$5$6";
|
||||||
$paramsstr = $9;
|
$paramsstr = $9;
|
||||||
@@ -985,7 +985,7 @@ while (my $d = readdir(DH)) {
|
|||||||
foreach (@decllines) {
|
foreach (@decllines) {
|
||||||
if ($decl eq '') {
|
if ($decl eq '') {
|
||||||
$decl = $_;
|
$decl = $_;
|
||||||
$decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
|
$decl =~ s/\Aextern\s+(SDL_DEPRECATED\s+|)(SDLMAIN_|SDL_)?DECLSPEC\s+(.*?)\s+(\*?)SDLCALL\s+/$3$4 /;
|
||||||
} else {
|
} else {
|
||||||
my $trimmed = $_;
|
my $trimmed = $_;
|
||||||
# !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
|
# !!! FIXME: trim space for SDL_DEPRECATED if it was used, too.
|
||||||
|
|||||||
Reference in New Issue
Block a user