| Home | Libraries | People | FAQ | More

### Macros

#### BOOST_FT_MAX_ARITY

Expands to a numeric value that describes the maximum function arity supported by the library.

Defaults to 20 if not explicitly defined by the user before inclusion of the first library header.

The following macros do not need to be defined, unless to configure the library to work with a compiler and/or calling convention not covered by the auto-detection mechanism in `boost/function_types/config/compiler.hpp`.

#### BOOST_FT_CC_NAMES

Expands to a sequence of ternary tuples (these data types are defined in the documentation of the Boost Preprocessor library). Each sequence element describes one calling convention specifier. The first element in each tuple is the macro suffix for `BOOST_FT_CC_*`, the second element is the name of the tag that describes the calling convention and the third is the name of the specifier. The specifier is allowed to be an empty string, so the third tuple element is either `BOOST_PP_EMPTY` or `BOOST_PP_IDENTITY``(name)`.

Define this macro to extend the set of possible names for custom calling conventions. The macro expands to nothing by default.

The following names are predefined by the library and must not occur in the definition of `BOOST_FT_CC_NAMES`:

    #define BOOST_FT_BUILTIN_CC_NAMES \
      (( IMPLICIT           , implicit_cc , BOOST_PP_EMPTY                ))\
      (( CDECL              , cdecl_cc    , BOOST_PP_IDENTITY(__cdecl   ) ))\
      (( STDCALL            , stdcall_cc  , BOOST_PP_IDENTITY(__stdcall ) ))\
      (( PASCAL             , pascal_cc   , BOOST_PP_IDENTITY(pascal    ) ))\
      (( FASTCALL           , fastcall_cc , BOOST_PP_IDENTITY(__fastcall) ))\
      (( CLRCALL            , clrcall_cc  , BOOST_PP_IDENTITY(__clrcall ) ))\
      (( THISCALL           , thiscall_cc , BOOST_PP_IDENTITY(__thiscall) ))\
      (( IMPLICIT_THISCALL  , thiscall_cc , BOOST_PP_EMPTY                ))
    // Don't get confused by the last line, here (thiscall can't be specified
    // explicitly prior to MSVC 8).

#### BOOST_FT_CC_*

Enables a specific calling convention. * denotes the macro suffix, as defined by `BOOST_FT_CC_NAMES` or `BOOST_FT_BUILTIN_CC_NAMES`.

The macro expands to a list of restrictions, separated by the `|` character. Possible items are:

- callable_builtin
- member
- non_member
- variadic
- non_variadic

If no such macro is defined for a particular calling convention, it is disabled. Example:

    #define BOOST_FT_CC_STDCALL non_variadic|callable_builtin
    // enables stdcall calling convention for all non-variadic,
    // callable, builtin types

#### BOOST_FT_COMMON_X86_CCs

Defining this macro causes the following macros to be defined, if not defined already:

    #define BOOST_FT_CC_CDECL BOOST_FT_COMMON_X86_CCs
    #define BOOST_FT_CC_STDCALL non_variadic|BOOST_FT_COMMON_X86_CCs
    #define BOOST_FT_CC_FASTCALL non_variadic|BOOST_FT_COMMON_X86_CCs

#### BOOST_FT_SYNTAX

This macro allows to change the syntax of callable builtin types. It is useful to handle the compiler specific placement of the calling convention specifier.

The default definition is as follows:

    #define BOOST_FT_SYNTAX(result,lparen,cc_spec,type_mod,name,rparen) \
              result() lparen() cc_spec() type_mod() name() rparen()

#### BOOST_FT_NULLARY_PARAM

Set to `void` for compilers that insist on a `void` parameter for nullary function types, empty by default.

#### BOOST_FT_NO_CV_FUNC_SUPPORT

Disables support for cv-qualified function types. Cv-qualified function types are illegal by the current standard version, but there is a pending defect report on that issue. It defaults to `1` until the standard changes, setting this macro to `0` may not work.

The following macros are useful for testing when changing the source code of the library.

#### BOOST_FT_PREPROCESSING_MODE

Makes the compiler preprocess as much as possible of the library code (rather than loading already-preprocessed header files) if defined.

#### BOOST_FT_CC_PREPROCESSING

Makes the compiler preprocess the loop over possible names for custom calling conventions (rather than loading an already-preprocessed header file) if defined.

This macro is defined automatically if `BOOST_FT_CC_NAMES` has been defined.