Skip to content

Engine → Modules

module_abi.h

The C front door of a shared module.

Structs

File Description
conjure_module_abi_signature Everything that must match exactly between a module binary and the host before any C++ object crosses the boundary. Pure C layout; compared field by field by compare_abi().
conjure_module_info What conjure_module_describe() returns: the signature plus the module name, which must equal the manifest name.

Type Aliases

conjure_module_describe_fn

typedef const conjure_module_info *(*conjure_module_describe_fn)(void);

conjure_module_entry_fn

typedef std::uint32_t (*conjure_module_entry_fn)(conjure::modules::module_context *context);

Forward Declarations

module_context

class module_context;

Constants

Name Type Value Description
ABI_ARCH_ARM64 inline constexpr std::uint32_t 2
ABI_ARCH_X64 inline constexpr std::uint32_t 1
ABI_COMPILER_APPLECLANG inline constexpr std::uint32_t 4
ABI_COMPILER_CLANG inline constexpr std::uint32_t 3
ABI_COMPILER_GCC inline constexpr std::uint32_t 2
ABI_COMPILER_MSVC inline constexpr std::uint32_t 1
ABI_RUNTIME_ASAN inline constexpr std::uint32_t 1u << 1
ABI_RUNTIME_DYNAMIC_CRT inline constexpr std::uint32_t 1u << 0
ABI_RUNTIME_UBSAN inline constexpr std::uint32_t 1u << 2
ABI_SIGNATURE_COMPILER_MAJOR inline constexpr std::uint32_t static_cast<std::uint32_t>(CONJURE_ABI_SIGNATURE_COMPILER_MAJOR) The compiler major the signature of this translation unit reports (see the header comment).
ABI_SIGNATURE_RUNTIME_FLAGS inline constexpr std::uint32_t ((CONJURE_ABI_SIGNATURE_DYNAMIC_CRT) != 0 ? ABI_RUNTIME_DYNAMIC_CRT : 0u) | ((CONJURE_ABI_SIGNATURE_ASAN) != 0 ? ABI_RUNTIME_ASAN : 0u) | ((CONJURE_ABI_SIGNATURE_UBSAN) != 0 ? ABI_RUNTIME_UBSAN : 0u) The runtime flags the signature of this translation unit reports: bit0 dynamic CRT, bit1 ASan, bit2 UBSan.
ABI_STDLIB_LIBCXX inline constexpr std::uint32_t 3
ABI_STDLIB_LIBSTDCXX inline constexpr std::uint32_t 2
ABI_STDLIB_MSVC inline constexpr std::uint32_t 1
ABI_STDLIB_UNKNOWN inline constexpr std::uint32_t 0

Functions

Public

compare_abi

[[nodiscard]] CONJURE_API core::result<void> compare_abi(
    const conjure_module_abi_signature &moduleSignature,
    const conjure_module_abi_signature &hostSignature);

Compares every field, structSize first (a smaller struct is rejected before any other field is read), then magic, abiVersion and the rest in declaration order. ABI_MISMATCH names the first differing field with the expected and actual values and asks for a rebuild.

host_abi_signature

[[nodiscard]] CONJURE_API const conjure_module_abi_signature &host_abi_signature() noexcept;

The signature the engine itself was built with.

make_abi_signature

[[nodiscard]] constexpr conjure_module_abi_signature make_abi_signature() noexcept;

The signature of the translation unit that calls it. CONJURE_TEST_ABI_VERSION_OVERRIDE and CONJURE_TEST_ENGINE_VERSION_OVERRIDE (a major version) exist for the mismatch fixtures only.

make_module_info

[[nodiscard]] constexpr conjure_module_info make_module_info(
    const char *name) noexcept;

The describe() payload of a module named name (a string literal that outlives the binary).