Attributes
Spice offers the option to annotate single function or whole modules via attributes.
Optional value for bool attributes
For attributes of type bool, the value true
can be omitted.
Module attributes¶
Available attributes¶
core.linker.flag: string (default: "")
: Append linker flagcore.linux.linker.flag: string (default: "")
: Append linker flag for Linuxcore.windows.linker.flag: string (default: "")
: Append linker flag for Windowscore.compiler.alwaysKeepOnNameCollision: bool (default: false)
: Always keep the symbols of this source files when merging the name registries of multiple source files
Function attributes¶
Spice | |
---|---|
Available attributes¶
core.compiler.mangle: bool (default: true)
: Enable/disable name mangling for the annotated functioncore.compiler.mangledName: string
: Set the mangled name for the annotated function
External declaration attributes¶
Available attributes¶
core.compiler.mangle: bool (default: true)
: Enable/disable name mangling for the annotated functioncore.compiler.mangledName: string
: Set the mangled name for the annotated functioncore.linker.dll: bool
: Enable linkage as dll (only relevant for Windows)test: bool
: Mark the annotated function as testtest.name: string
: Set the name of the test (only procedures with thetest
attribute are considered as tests)test.skip: bool
: Skip the annotated function (only procedures with thetest
attribute are considered as tests)
Struct attributes¶
Available attributes¶
core.compiler.alwaysEmitVTable: bool
: Always emit a vtable for the annotated structcore.compiler.packed: bool
: Pack the annotated struct
Interface attributes¶
Available attributes¶
core.compiler.fixedTypeId: int
: Set a fixed type id for the annotated interface. Intended for internal use only.