From e758da9af94b93940381a417a7d27434ff6e7af1 Mon Sep 17 00:00:00 2001 From: Esteban Zimanyi Date: Sat, 11 Jul 2026 02:32:10 +0200 Subject: [PATCH] Define the optional family macros when parsing the headers A handful of public declarations in the core headers are guarded by `#if ` (for example `meos_initialize_pointcloud`, `rtree_create_tpcbox`, and the `pointcloud_basetype` / `pointcloudset_type` / `tpointcloud_temptype` catalog predicates behind `#if POINTCLOUD` in meos.h and meos_catalog.h). The family headers themselves are unguarded, so their functions were captured, but these gated core-header declarations were preprocessed out and never reached the catalog. MobilityDB's `ALL=ON` build enables every optional family, each defining a `-D=1` compile flag. Mirror that here so the catalog reflects the full all-families surface. The family list is kept alphabetically ordered, in sync with the CMakeLists.txt `if(ALL)` loop. --- parser/parser.py | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/parser/parser.py b/parser/parser.py index 30f657f..b16dfc2 100644 --- a/parser/parser.py +++ b/parser/parser.py @@ -97,6 +97,18 @@ def merge_meta(idl: dict, meta_path: Path) -> dict: return idl +# The optional families MobilityDB's ``ALL=ON`` build enables, each defining a +# ``-D=1`` compile flag. Mirror that build here so declarations guarded +# by ``#if `` in the core headers (e.g. ``#if POINTCLOUD`` around +# ``meos_initialize_pointcloud`` in meos.h) enter the catalog — the family +# headers themselves are unguarded, but a handful of core-header declarations +# are gated. Kept in sync with MobilityDB CMakeLists.txt's ``if(ALL) foreach``. +_ALL_FAMILIES = ( + "ARROW", "CBUFFER", "H3", "JSON", "NPOINT", "POINTCLOUD", "POSE", + "QUADBIN", "RASTER", "RGEO", +) + + def parse_meos(entry: Path, include_dir: Path) -> dict: index = clang.cindex.Index.create() tu = index.parse(str(entry), args=[ @@ -110,6 +122,7 @@ def parse_meos(entry: Path, include_dir: Path) -> dict: # it, and an undefined ``UNUSED`` makes clang error on the declarator and # silently drop the remaining parameters of that prototype. "-DUNUSED=__attribute__((unused))", + *(f"-D{family}=1" for family in _ALL_FAMILIES), ] + _clang_extra_args(), # Record ``#define`` macro definitions as cursors so the public # object-like integer macros (WKB / WKT variant flags, ``MEOS_FLAG_*``)