mirror of
https://github.com/libsdl-org/SDL.git
synced 2025-05-31 08:57:40 +00:00
wikiheaders: Allow basic typedefs to pull in some preprocessor logic.
Reference Issue #9557. This lets SDL_AudioFormat have the `#if byteorder == lilendian` section.
This commit is contained in:
parent
a13bdeee8a
commit
6b1a98e664
3 changed files with 14 additions and 15 deletions
|
@ -860,6 +860,7 @@ while (my $d = readdir(DH)) {
|
|||
}
|
||||
|
||||
# We assume any `#define`s directly after the typedef are related to it: probably bitflags for an integer typedef.
|
||||
# We'll also allow lines that start with `#if` or `#else` or `#elif`
|
||||
# Blank lines are allowed, anything else, even comments, are not.
|
||||
my $blank_lines = 0;
|
||||
my $lastpos = tell(FH);
|
||||
|
@ -869,7 +870,7 @@ while (my $d = readdir(DH)) {
|
|||
|
||||
if (/\A\s*\Z/) {
|
||||
$blank_lines++;
|
||||
} elsif (/\A\s*\#define\s+/) {
|
||||
} elsif (/\A\s*\#(define|if|else|elif)(\s+|\Z)/) {
|
||||
if ($blank_lines > 0) {
|
||||
while ($blank_lines > 0) {
|
||||
$additional_decl .= "\n";
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue