Attribute Macro interoptopus_proc::ffi_constant
source · #[ffi_constant]
Expand description
Enables a const
to appear in generated bindings.
This will derive ConstantInfo
for a helper struct of the
same name containing the const’s name and value.
Constant evaluation is supported.
In order to appear in generated bindings the constant also has to be mentioned in the inventory function.
§Examples
use interoptopus::ffi_constant;
#[ffi_constant]
const SOME_CONST: u32 = 314;
#[ffi_constant]
const COMPUTED_CONST: u8 = double(12); // will export 24