Keywords: Feature macros, TBB_DEPRECATED, TBB_USE_EXCEPTIONS, TBB_USE_CAPTURED_EXCEPTION

# Feature macros

Macros in this section control optional features in the library.

## `TBB_DEPRECATED` macro

The macro `TBB_DEPRECATED` controls deprecated features that would otherwise conflict with non-deprecated use. Define it to be 1 to get deprecated Intel® Threading Building Blocks (Intel® TBB) 2.1 interfaces.

## `TBB_USE_EXCEPTIONS` macro

The macro `TBB_USE_EXCEPTIONS` controls whether the library headers use exception-handling constructs such as `try`, `catch`, and `throw`. The headers do not use these constructs when `TBB_USE_EXCEPTIONS=0`.

For the Microsoft Windows*, Linux*, and MacOS* operating systems, the default value is 1 if exception handling constructs are enabled in the compiler, and 0 otherwise.

### Caution

The runtime library may still throw an exception when `TBB_USE_EXCEPTIONS=0`.

## `TBB_USE_CAPTURED_EXCEPTION` macro

The macro `TBB_USE_CAPTURED_EXCEPTION` controls rethrow of exceptions within the library. Because C++ 1998 does not support catching an exception on one thread and rethrowing it on another thread, the library sometimes resorts to rethrowing an approximation called `tbb::captured_exception`.

- Define `TBB_USE_CAPTURED_EXCEPTION=1` to make the library rethrow an approximation. This is useful for uniform behavior across platforms.

- Define `TBB_USE_CAPTURED_EXCEPTION=0` to request rethrow of the exact exception. This setting is valid only on platforms that support the std::exception_ptr feature of C++11. Otherwise a compile-time diagnostic is issued.

The default value is `1` for supported host compilers with `std::exception_ptr`, and `0` otherwise.

Parent topic: Environment

## See Also

Exceptions