已合并
Fix parsing of function pointer typedefs for Doxygen >= 1.18 #4
Funda Wang创建于 8月15日
Fix parsing of function pointer typedefs for Doxygen >= 1.18 #4
已合并
从已删除 :fix-typedef-doxygen-1.18合入到src-openeuler/python-sphinxygenmaster
共 2 个文件变更+37-1
| @@ -0,0 +1,32 @@ | |||
| 1 | +From e5dabce2c33849fe6a1def6fdd6a1e5bf4175c9d Mon Sep 17 00:00:00 2001 | ||
| 2 | +From: AtomCode <noreply@atomgit.com> | ||
| 3 | +Date: Sat, 15 Aug 2026 08:59:44 +0800 | ||
| 4 | +Subject: [PATCH] Fix parsing of function pointer typedefs for Doxygen >= 1.18 | ||
| 5 | + | ||
| 6 | +Doxygen 1.18 changed the XML layout of function pointer typedefs: | ||
| 7 | +<type> now contains the full "void(*)" fragment and <argsstring> starts | ||
| 8 | +with "(" instead of ")". Normalize the new layout back to the previous | ||
| 9 | +one so the generated markup is unchanged and the assertion in | ||
| 10 | +read_typedef() is satisfied for both Doxygen versions. | ||
| 11 | + | ||
| 12 | +Co-Authored-By: AtomCode (deepseek-v4-flash) <noreply@atomgit.com> | ||
| 13 | +--- | ||
| 14 | + src/sphinxygen/sphinxygen.py | 5 +++++ | ||
| 15 | + 1 file changed, 5 insertions(+) | ||
| 16 | + | ||
| 17 | +diff --git a/src/sphinxygen/sphinxygen.py b/src/sphinxygen/sphinxygen.py | ||
| 18 | +index 4122e2b..383da49 100644 | ||
| 19 | +--- a/src/sphinxygen/sphinxygen.py | ||
| 20 | ++++ b/src/sphinxygen/sphinxygen.py | ||
| 21 | +@@ -709,6 +709,11 @@ def read_member_doc(index, lang, member): | ||
| 22 | + args_text = member.find("argsstring").text | ||
| 23 | + target_text = plain_text(member.find("type")) | ||
| 24 | + if args_text is not None: # Function pointer | ||
| 25 | ++ if target_text[-2:] == "*)" and args_text[0] == "(": | ||
| 26 | ++ # Doxygen >= 1.18 emits "void(*)" in <type> and "(...)" in | ||
| 27 | ++ # <argsstring> instead of "void(*" and ")(...)" as before. | ||
| 28 | ++ target_text = target_text[:-1] # "void(*)" -> "void(*" | ||
| 29 | ++ args_text = ")" + args_text # "(...)" -> ")(...)" | ||
| 30 | + assert target_text[-2:] == "(*" and args_text[0] == ")" | ||
| 31 | + record["type"] = target_text + args_text | ||
| 32 | + record["definition"] = target_text + name + args_text | ||
| @@ -1,6 +1,6 @@ | |||
| 1 | Name: python-sphinxygen | 1 | Name: python-sphinxygen |
| 2 | Version: 1.0.12 | 2 | Version: 1.0.12 |
| 3 | -Release: 1 | 3 | +Release: 2 |
| 4 | Summary: A script to read Doxygen XML output and emit ReST for Sphinx | 4 | Summary: A script to read Doxygen XML output and emit ReST for Sphinx |
| 5 | 5 | ||
| 6 | License: ISC | 6 | License: ISC |
| @@ -8,6 +8,7 @@ URL: https://gitlab.com/drobilla/sphinxygen | |||
| 8 | Source0: %{url}/-/archive/v%{version}/sphinxygen-v%{version}.tar.gz | 8 | Source0: %{url}/-/archive/v%{version}/sphinxygen-v%{version}.tar.gz |
| 9 | 9 | ||
| 10 | Patch0: Modify-Doxyfile-to-relax-warning-restrictions.patch | 10 | Patch0: Modify-Doxyfile-to-relax-warning-restrictions.patch |
| 11 | +Patch1: Fix-typedef-parsing-for-doxygen-1.18.patch | ||
| 11 | 12 | ||
| 12 | BuildRequires: python3-devel | 13 | BuildRequires: python3-devel |
| 13 | BuildRequires: python3-pytest | 14 | BuildRequires: python3-pytest |
| @@ -55,6 +56,9 @@ pytest | |||
| 55 | %{_mandir}/man1/sphinxygen.1* | 56 | %{_mandir}/man1/sphinxygen.1* |
| 56 | 57 | ||
| 57 | %changelog | 58 | %changelog |
| 59 | +* Sat Aug 15 2026 Funda Wang <fundawang@yeah.net> - 1.0.12-2 | ||
| 60 | +- Fix parsing of function pointer typedefs for Doxygen >= 1.18 | ||
| 61 | + | ||
| 58 | * Fri Mar 06 2026 zhang_jian <zhang_jian7@hoperun.com> - 1.0.12-1 | 62 | * Fri Mar 06 2026 zhang_jian <zhang_jian7@hoperun.com> - 1.0.12-1 |
| 59 | - update to 1.0.12 | 63 | - update to 1.0.12 |
| 60 | - Fix documentation for C++ namespaces | 64 | - Fix documentation for C++ namespaces |