Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

C API header generation for Go bindings #14944

Open
wants to merge 9 commits into
base: main
Choose a base branch
from
Open
Prev Previous commit
Next Next commit
Merge branch 'main' into go-c-api-gen
# Conflicts:
#	scripts/generate_c_api.py
  • Loading branch information
taniabogatsch committed Dec 23, 2024
commit a3b6893a0be1d96b771d95476a6063bd64067096
6 changes: 4 additions & 2 deletions scripts/generate_c_api.py
Original file line number Diff line number Diff line change
Expand Up @@ -611,6 +611,7 @@ def create_extension_api_struct(
extension_struct_finished += " return result;\n"
extension_struct_finished += "}\n\n"

# TODO! align with changes
if with_member_invoker:
extension_struct_finished += f'extern {DUCKDB_EXT_API_STRUCT_TYPENAME} *{DUCKDB_EXT_API_VAR_NAME};\n\n'
extension_struct_finished += COMMENT_HEADER("Invoker Functions")
Expand Down Expand Up @@ -658,6 +659,7 @@ def create_duckdb_ext_h_versioning(
# Create the versioning defines
major, minor, patch = parse_semver(ext_api_version)
versioning_defines = f"""//! Set version to latest if no explicit version is defined

#if !defined(DUCKDB_EXTENSION_API_VERSION_MAJOR) && !defined(DUCKDB_EXTENSION_API_VERSION_MINOR) && !defined(DUCKDB_EXTENSION_API_VERSION_PATCH)
#define DUCKDB_EXTENSION_API_VERSION_MAJOR {major}
#define DUCKDB_EXTENSION_API_VERSION_MINOR {minor}
Expand All @@ -667,8 +669,8 @@ def create_duckdb_ext_h_versioning(
#endif

//! Set the DUCKDB_EXTENSION_API_VERSION_STRING which is passed to DuckDB on extension load
#if DUCKDB_EXTENSION_API_VERSION_DEV
#define DUCKDB_EXTENSION_API_VERSION_STRING "dev"
#ifdef DUCKDB_EXTENSION_API_UNSTABLE_VERSION
#define DUCKDB_EXTENSION_API_VERSION_STRING DUCKDB_EXTENSION_API_UNSTABLE_VERSION
#else
#define DUCKDB_EXTENSION_API_VERSION_STRING DUCKDB_EXTENSION_SEMVER_STRING(DUCKDB_EXTENSION_API_VERSION_MAJOR, DUCKDB_EXTENSION_API_VERSION_MINOR, DUCKDB_EXTENSION_API_VERSION_PATCH)
#endif
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.