From ca2d7f984439995a0b4fd6dbdd34efca42380362 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sun, 26 May 2024 13:34:13 -0400 Subject: [PATCH] gendynapi.py: Ignore wiki documentation blocks. Otherwise, it thinks SDL_CreateThread, etc, are real functions. Reference Issue #9890. --- src/dynapi/gendynapi.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/dynapi/gendynapi.py b/src/dynapi/gendynapi.py index 998820da38..b9c0847b68 100755 --- a/src/dynapi/gendynapi.py +++ b/src/dynapi/gendynapi.py @@ -75,8 +75,21 @@ def main(): parsing_comment = False current_comment = "" + ignore_wiki_documentation = False + for line in input: + # Skip lines if we're in a wiki documentation block. + if ignore_wiki_documentation: + if line.startswith("#endif"): + ignore_wiki_documentation = False + continue + + # Discard wiki documentions blocks. + if line.startswith("#ifdef SDL_WIKI_DOCUMENTATION_SECTION"): + ignore_wiki_documentation = True + continue + # Discard pre-processor directives ^#.* if line.startswith("#"): continue