From 3896b1b3f4cb1388f15cd42940560011e24ef6b0 Mon Sep 17 00:00:00 2001
From: "Ryan C. Gordon" <[EMAIL REDACTED]>
Date: Sun, 15 Jun 2025 22:32:15 -0400
Subject: [PATCH] wikiheaders: Let each subproject specify how to find their
property symbols.
---
.wikiheaders-options | 1 +
build-scripts/wikiheaders.pl | 4 +++-
2 files changed, 4 insertions(+), 1 deletion(-)
diff --git a/.wikiheaders-options b/.wikiheaders-options
index 88d48cfbe0f8e..38a2f2731ca65 100644
--- a/.wikiheaders-options
+++ b/.wikiheaders-options
@@ -9,6 +9,7 @@ versionfname = include/SDL3/SDL_version.h
versionmajorregex = \A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z
versionminorregex = \A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z
versionmicroregex = \A\#define\s+SDL_MICRO_VERSION\s+(\d+)\Z
+apipropertyregex = \A\s*\#\s*define\s+SDL_PROP_
selectheaderregex = \ASDL.*?\.h\Z
projecturl = https://libsdl.org/
wikiurl = https://wiki.libsdl.org
diff --git a/build-scripts/wikiheaders.pl b/build-scripts/wikiheaders.pl
index 220f13679b598..c2732af52e0ee 100755
--- a/build-scripts/wikiheaders.pl
+++ b/build-scripts/wikiheaders.pl
@@ -32,6 +32,7 @@
my $incsubdir = 'include';
my $readmesubdir = undef;
my $apiprefixregex = undef;
+my $apipropertyregex = undef;
my $versionfname = 'include/SDL_version.h';
my $versionmajorregex = '\A\#define\s+SDL_MAJOR_VERSION\s+(\d+)\Z';
my $versionminorregex = '\A\#define\s+SDL_MINOR_VERSION\s+(\d+)\Z';
@@ -110,6 +111,7 @@
$srcpath = $val, next if $key eq 'srcpath';
$wikipath = $val, next if $key eq 'wikipath';
$apiprefixregex = $val, next if $key eq 'apiprefixregex';
+ $apipropertyregex = $val, next if $key eq 'apipropertyregex';
$projectfullname = $val, next if $key eq 'projectfullname';
$projectshortname = $val, next if $key eq 'projectshortname';
$wikisubdir = $val, next if $key eq 'wikisubdir';
@@ -1366,7 +1368,7 @@ sub generate_quickref {
# update strings now that we know everything pending is to be applied to this declaration. Add pending blank lines and the new text.
# At Sam's request, don't list property defines with functions. (See #9440)
- my $is_property = /\A\s*\#\s*define\s+SDL_PROP_/;
+ my $is_property = (defined $apipropertyregex) ? /$apipropertyregex/ : 0;
if (!$is_property) {
if ($blank_lines > 0) {
while ($blank_lines > 0) {