Configuration Macros

#include <boost/int128/config.hpp>

User Configurable Macros

These macros allow customization of library behavior. User-configurable macros should be defined before including any library headers.

  • BOOST_INT128_NO_BUILTIN_INT128: The user may define this when they do not want the internal implementations to rely on builtin __int128 or unsigned __int128 types.

  • BOOST_INT128_ALLOW_SIGN_COMPARE: Allows comparisons between this library’s types and built-in types of opposite signedness. Analogous to disabling GCC’s -Wsign-compare warning.

NOT DEFINED BY DEFAULT FOR CORRECTNESS
  • BOOST_INT128_ALLOW_SIGN_CONVERSION: Allows arithmetic operations between this library’s types and built-in types of opposite signedness. Analogous to disabling GCC’s -Wsign-conversion warning. Implies BOOST_INT128_ALLOW_SIGN_COMPARE.

NOT DEFINED BY DEFAULT FOR CORRECTNESS
  • BOOST_INT128_DISABLE_EXCEPTIONS: Allows exceptions to be disabled. This macro will automatically be defined in the presence of -fno-exceptions or similar MSVC flags.

Automatic Configuration Macros

  • BOOST_INT128_HAS_INT128: This is defined when compiling on a platform that has builtin __int128 or unsigned __int128 types (e.g. __x86_64__).

  • BOOST_INT128_ENDIAN_LITTLE_BYTE: This is defined to 1 when compiling on a little endian architecture, otherwise 0.

  • BOOST_INT128_ENDIAN_BIG_BYTE: This is defined to 1 when compiling on a big endian architecture, otherwise 0.

  • BOOST_INT128_HOST_DEVICE: This is defined to __host__ __device__ when compiling with NVCC (__NVCC__ is defined), and to nothing otherwise. All public functions, constructors, operators, and conversion operators in the library are annotated with this macro, allowing int128_t and uint128_t to be used in CUDA device code without modification.