Extract public #define integer macros into the catalog#46
Merged
estebanzimanyi merged 1 commit intoJul 10, 2026
Merged
Conversation
The MEOS public headers expose a set of integer constants as object-like #define macros rather than enum values — the WKB / WKT output-variant flags (WKB_NDR, WKB_EXTENDED, WKB_XDR …), the MEOS_FLAG_* bit masks, and similar. An enum walk never sees them, so a binding derived purely from the catalog cannot carry them, yet a binding's FFI needs them (meos-rs selects a WKB variant with WKB_EXTENDED / WKB_NDR / WKB_XDR). Parse the amalgamation with the detailed preprocessing record so #define definitions surface as cursors, and record each public object-like integer macro under a new catalog macros[] array (name, value, file, family). Function-like and expression / string macros are skipped.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
A set of MEOS public integer constants are object-like
#definemacros rather thanenumvalues — the WKB / WKT output-variant flags (WKB_NDR,WKB_EXTENDED,WKB_XDR, …), theMEOS_FLAG_*bit masks, and similar. Anenumwalk never sees them, so a binding derived purely from the catalog cannot carry them, yet a binding's FFI needs them (meos-rsselects a WKB variant withWKB_EXTENDED/WKB_NDR/WKB_XDR).The amalgamation is parsed with the detailed preprocessing record so
#definedefinitions surface as cursors. Each public object-like integer macro is recorded under a new catalogmacros[]array with itsname,value,file, andfamily. Function-like macros and expression / string macros are skipped.The installed public headers yield 36 macros; function, struct, and enum extraction are unchanged. A regression test covers the WKB variant flags, the integer-value invariant, and the object-like-only filter.