From cc9bab1dc67430aeafa925ade8915ea621119aba Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Esteban=20Zim=C3=A1nyi?= Date: Tue, 27 Oct 2026 16:43:51 +0100 Subject: [PATCH] Name no GEOS type or header in the generated bindings The public MEOS headers expose H3 as the one dependency whose header a consumer compiles against: no header includes a GEOS or GSL header, and no catalog function takes or returns a GEOSContextHandle_t. The generator therefore lists no GEOS type among the opaque types it leaves unwrapped, and the cgo preamble names H3 alone. Measured: against the libmeos of MobilityDB a23e01a60b, the regenerated packages differ from main only in that preamble comment, keeping 3994 flat wrappers and 1435 methods; the functions and types packages build, the portable-parity test and the gomeos examples pass. Why: MEOS answers without GEOS, and a binding states the dependencies the library has. --- functions/cgo.go | 3 +-- tools/codegen.py | 5 ++--- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/functions/cgo.go b/functions/cgo.go index 572c26b..aad5f25 100644 --- a/functions/cgo.go +++ b/functions/cgo.go @@ -17,8 +17,7 @@ package functions // H3 ships no pkg-config file, so the one dependency whose header the public // MEOS headers expose (meos_h3.h includes ) names its include dir -// here. GEOS and GSL, the other exposed dependencies, resolve from the default -// include path. +// here. #cgo darwin CFLAGS: -I/opt/homebrew/include/h3 #cgo linux CFLAGS: -I/usr/include/h3 diff --git a/tools/codegen.py b/tools/codegen.py index 5e25411..7417c8c 100644 --- a/tools/codegen.py +++ b/tools/codegen.py @@ -43,7 +43,7 @@ # Forward-declared opaque types we never wrap (mirrors the cdef skip list # the PyMEOS-CFFI builder applies). -OPAQUE_TYPES = ("json_object", "GEOSContextHandle_t") +OPAQUE_TYPES = ("json_object",) # C-name skip list: functions handled by hand or intentionally hidden. # CODEGEN-REGULAR-EXCEPTION: this is the documented audit bucket for the @@ -1120,8 +1120,7 @@ def _todo_stub(c_name: str, reason: str) -> str: // H3 ships no pkg-config file, so the one dependency whose header the public // MEOS headers expose (meos_h3.h includes ) names its include dir -// here. GEOS and GSL, the other exposed dependencies, resolve from the default -// include path. +// here. #cgo darwin CFLAGS: -I/opt/homebrew/include/h3 #cgo linux CFLAGS: -I/usr/include/h3