Method CompilerEnvironment()->CPP()->define_macro()


Method define_macro

void define_macro(string name, string|object|array|function(:void)|void value, int(-1..)|void numargs, int(2bit)|void flags)

Description

Define a cpp macro.

Parameter name

Name of macro to define. Ending the name with "()" changes the defaults for numargs and flags to 0 and 3 respectively.

Parameter value

Macro definition. Defaults to "1".

Parameter numargs

Number of required arguments to a function-style macro. -1 indicates not function-style. Defaults to -1.

Parameter flags

Bit-wise or of flags affecting the macro behavior:

1

Function style macro with a variable number of arguments. Invalid if numargs is -1.

2

Keep newlines emitted by the macro.

Defaults to 0.

See also

define_multiple_macros()