Skip to content

Prepend a stdbool stub when invoking libclang on MEOS headers#1

Open
estebanzimanyi wants to merge 1 commit into
masterfrom
fix/stdbool-stub
Open

Prepend a stdbool stub when invoking libclang on MEOS headers#1
estebanzimanyi wants to merge 1 commit into
masterfrom
fix/stdbool-stub

Conversation

@estebanzimanyi
Copy link
Copy Markdown
Member

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.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant