Skip to content

[ABI] Change VTK_ABI_NAMESPACE_NAME, add C Mangling

Consumer Related

  • These changes should only affect your project if you were already using the VTK_ABI_NAMESPACE_NAME CMake configuration argument and adding __attribute__'s to it.
  • VTK_ABI_NAMESPACE_NAME now only accepts arguments matching the regular expression ^[a-zA-Z0-9_]+$ (so that it can be used in the C mangling macros).
  • Things like __attribute__((visibility("hidden")) must be provided in the new CMake configuration argument VTK_ABI_NAMESPACE_ATTRIBUTES.
  • Adds a new macro VTK_ABI_NAMESPACE_MANGLE for mangling internal symbols (e.g., extern "C" { some_func(); }).
    • Internal C symbols are now properly mangled.

Internal to VTK

  • Fixes the ABI namespace build and associated mangling tests.
  • Removes mangling from python and java.
  • Introduces a new mangling CI build which turns on as many modules as possible and configures a build of VTK with -DVTK_ABI_NAMESPACE_NAME.
    • This build failing means you likely missed a VTK_ABI_NAMESPACE_BEGIN, VTK_ABI_NAEMSPACE_END, or something else small. Forward declarations need to happen inside the ABI namespace (most common mistake).
    • If the mangling tests are failing, then you will need to identify if your symbol should be getting exposed in the first place. If so, use the VTK_ABI_NAMESPACE_MANGLE macro (see changes here for examples) to mangle the symbols.

CC @ryan.krattiger1 @ben.boeckel @mwestphal

Edited by Stephen McDowell

Merge request reports