Prepend a stdbool stub when invoking libclang on MEOS headers#1
Open
estebanzimanyi wants to merge 2 commits into
Open
Prepend a stdbool stub when invoking libclang on MEOS headers#1estebanzimanyi wants to merge 2 commits into
estebanzimanyi wants to merge 2 commits into
Conversation
MEOS public headers reference bool but do not include stdbool.h; when libclang parses them without system header paths it silently demotes every bool return and bool * pointer to int / int *, losing the distinction that every binding depends on. Prepending a minimal stub with `#define bool _Bool` (plus the size_t typedef libclang needs to honour the WKB-size accessors) keeps the spelling intact, and a regex-based normaliser in _c_spelling rewrites the resulting `_Bool *` back to `bool *` so the IDL matches the source code. Before the fix all 641 bool-returning functions and the bool * out-parameters of tbox_*_inc / tbool_value_at_timestamptz / tbool_value_n / tbool_values landed in meos-idl.json as int.
Without a real pg_config.h, postgres/c.h never typedefs int64, so int64 and every type built on it (TimestampTz, Timestamp, TimeADT, DateADT) collapsed to implicit int and timestamp parameters were emitted 32-bit. Extend the system-header stub with the postgres integer family, mirroring postgres/c.h (LP64 branch), timestamp_def.h and date.h exactly.
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.
MEOS public headers reference bool but do not include stdbool.h; when libclang parses them without system header paths it silently demotes every bool return and bool * pointer to int / int , losing the distinction that every binding depends on. Prepending a minimal stub with #define bool _Bool (plus the size_t typedef libclang needs to honour the WKB-size accessors) keeps the spelling intact, and a regex-based normaliser in _c_spelling rewrites the resulting Bool * back to bool * so the IDL matches the source code. Before the fix all 641 bool-returning functions and the bool * out-parameters of tbox_inc / tbool_value_at_timestamptz / tbool_value_n / tbool_values landed in meos-idl.json as int.