Attribute Macro interoptopus::ffi_constant [−][src]
#[ffi_constant]
This is supported on crate feature
derive
only.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 has to be mentioned in the definition
of the libaries inventory!()
.
Examples
use interoptopus::ffi_constant;
#[ffi_constant]
const SOME_CONST: u32 = 314;
#[ffi_constant]
const COMPUTED_CONST: u8 = double(12); // will export 24