docs: expand EXTERN_C guard macros in the Doxygen API build#620
Conversation
Doxygen ran with MACRO_EXPANSION off, so the unexpanded EXTERN_C_BEGIN token was glued onto the first declaration in each public header — e.g. SolidSyslogSsize rendered with type "EXTERN_C_BEGIN typedef intptr_t" instead of "intptr_t", across ~37 headers. Turn on MACRO_EXPANSION with EXPAND_ONLY_PREDEF and predefine both guard macros to empty, so Doxygen sees plain file-scope C declarations while every other macro (the SOLIDSYSLOG_* constants) stays documented by name. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Path: .coderabbit.yaml Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (1)
WalkthroughThe Doxygen configuration now enables controlled macro expansion and explicitly removes ChangesDoxygen documentation configuration
Estimated code review effort: 2 (Simple) | ~10 minutes 🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
☀️ Quality Summary 🚦 build-linux-gcc: 100% successful (✔️ 1522 passed) Created by Quality Monitor v1.14.0 (#f3859fd). More details are shown in the GitHub Checks Result. |
What
Doxygen runs (via mkdoxy) with
MACRO_EXPANSIONoff, so the unexpandedEXTERN_C_BEGINtoken gets glued onto the first declaration in each public header. For example,SolidSyslogSsizeinSolidSyslogStream.hrendered with typeEXTERN_C_BEGIN typedef intptr_tinstead ofintptr_t. This hit ~37 headers — whichever symbol immediately followsEXTERN_C_BEGINin each (SolidSyslogCrc16_Compute,SolidSyslogFatFsFile_Create,SolidSyslogConfigLockFunction, …).Fix
In
mkdocs.ymlunderdoxy-cfg:MACRO_EXPANSION: true— let the preprocessor expand macrosEXPAND_ONLY_PREDEF: true— but only the ones we list, so theSOLIDSYSLOG_*constants stay documented by name rather than expanded to their valuesPREDEFINED: "EXTERN_C_BEGIN= EXTERN_C_END="— expand both C-linkage guard macros to nothingDoxygen then sees plain file-scope C declarations, which matches
OPTIMIZE_OUTPUT_FOR_C.Verification
Built the docs locally in the
mkdocs-mkdoxy:sha-34173c0container withmkdocs build --strict:mkdocs build --strictpasses<definition>EXTERN_C_BEGINcount dropped from 37 → 0;SolidSyslogSsizetype is nowtypedef intptr_tSolidSyslogSsizewith zeroEXTERN_C_BEGINleakage🤖 Generated with Claude Code
Summary by CodeRabbit