Skip to content

Export C ABI and protocol handler host symbols with default visibility - #98

Merged
lijy91 merged 2 commits into
mainfrom
fix/capi-default-visibility
Nov 22, 2026
Merged

lijy91 merged 2 commits into
mainfrom
fix/capi-default-visibility

Conversation

@lijy91

@lijy91 lijy91 commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Refs libnativeapi/nativeapi#25
Companion: libnativeapi/nativeapi#44

Explicitly export the generated C ABI and protocol host entry points so shared-library builds can hide internal C++ implementation symbols without losing the FFI contract.

  • Define FFI_PLUGIN_EXPORT with default visibility on GCC/Clang, alongside the existing Windows dllexport annotation.
  • Export nativeapi_protocol_handler_host_attach and nativeapi_protocol_handler_host_deliver, which hosts resolve by name.
  • Include current core main (60fa795) in the branch; the workspace companion updates the generator and native-asset build flags together.

Validation against the matching workspace generator: ./codegen check reports 77 C ABI and 386 binding files up to date. macOS arm64 and Linux x64 builds retained all 685 required C ABI, Dart shim and protocol-host exports and enumerated real displays. The macOS nativeapi_flutter suite passed all 11 tests. The companion PR's strict export checks found no internal C++ exports and measured native-library reductions of 57.6% on Linux and 50.6% on macOS.

@lijy91
lijy91 merged commit 1d5a4fe into main Nov 22, 2026
10 checks passed
@lijy91
lijy91 deleted the fix/capi-default-visibility branch November 22, 2026 10:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant