From 2ee1c87eb03512e984d8289122c29dd119eede64 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Thu, 25 Apr 2024 16:46:43 -0400
Subject: [PATCH] wikiheaders: Fixed preprocessor line check to include
`#endif`.
Reference Issue #9557.
---
build-scripts/wikiheaders.pl | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index 799aeb03dd94f..1357dd7eaf149 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -860,7 +860,7 @@ sub print_undocumented_section {
}
# 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`
+ # We'll also allow some other basic preprocessor lines.
# Blank lines are allowed, anything else, even comments, are not.
my $blank_lines = 0;
my $lastpos = tell(FH);
@@ -870,7 +870,7 @@ sub print_undocumented_section {
if (/\A\s*\Z/) {
$blank_lines++;
- } elsif (/\A\s*\#(define|if|else|elif)(\s+|\Z)/) {
+ } elsif (/\A\s*\#(define|if|else|elif|endif)(\s+|\Z)/) {
if ($blank_lines > 0) {
while ($blank_lines > 0) {
$additional_decl .= "\n";