| 1 | // SPDX-License-Identifier: BSD-3-Clause |
| 2 | // Copyright Contributors to the OpenEXR Project. |
| 3 | |
| 4 | // This file is auto-generated by the cmake configure step |
| 5 | |
| 6 | #ifndef INCLUDED_IMATH_CONFIG_H |
| 7 | #define INCLUDED_IMATH_CONFIG_H 1 |
| 8 | |
| 9 | #pragma once |
| 10 | |
| 11 | // |
| 12 | // Options / configuration based on O.S. / compiler |
| 13 | // |
| 14 | |
| 15 | // |
| 16 | // Define whether the half-to-float conversion should use the lookup |
| 17 | // table method. Note that this is overriden by F16C compiler |
| 18 | // flags. It is also overrided by the IMATH_HALF_NO_LOOKUP_TABLE |
| 19 | // macro, if defined. |
| 20 | // |
| 21 | #define IMATH_HALF_USE_LOOKUP_TABLE |
| 22 | |
| 23 | // |
| 24 | // Define if the target system has support for large |
| 25 | // stack sizes. |
| 26 | // |
| 27 | /* #undef IMATH_HAVE_LARGE_STACK */ |
| 28 | |
| 29 | ////////////////////// |
| 30 | // |
| 31 | // C++ namespace configuration / options |
| 32 | |
| 33 | // Current (internal) library namepace name and corresponding public |
| 34 | // client namespaces. |
| 35 | #define IMATH_INTERNAL_NAMESPACE_CUSTOM 0 |
| 36 | #define IMATH_INTERNAL_NAMESPACE Imath_3_1 |
| 37 | |
| 38 | |
| 39 | #define IMATH_NAMESPACE_CUSTOM 0 |
| 40 | #define IMATH_NAMESPACE Imath |
| 41 | |
| 42 | |
| 43 | // |
| 44 | // Version information |
| 45 | // |
| 46 | #define IMATH_VERSION_STRING "3.1.9" |
| 47 | #define IMATH_PACKAGE_STRING "Imath 3.1.9" |
| 48 | |
| 49 | #define IMATH_VERSION_MAJOR 3 |
| 50 | #define IMATH_VERSION_MINOR 1 |
| 51 | #define IMATH_VERSION_PATCH 9 |
| 52 | #define IMATH_VERSION_RELEASE_TYPE "" |
| 53 | |
| 54 | #define IMATH_VERSION_HEX ((uint32_t(IMATH_VERSION_MAJOR) << 24) | \ |
| 55 | (uint32_t(IMATH_VERSION_MINOR) << 16) | \ |
| 56 | (uint32_t(IMATH_VERSION_PATCH) << 8)) |
| 57 | |
| 58 | // IMATH_LIB_VERSION is the library API version: SOCURRENT.SOAGE.SOREVISION |
| 59 | #define IMATH_LIB_VERSION_STRING "29.8.0" |
| 60 | |
| 61 | // |
| 62 | // Code that depends on the v2 ExcMath mechanism of signal handlers |
| 63 | // that throw exceptions is incompatible with noexcept, since |
| 64 | // floating-point overflow and underflow can occur in a wide variety |
| 65 | // of computations within Imath functions now marked with |
| 66 | // noexcept. Code that needs to accomodate the exception-handling |
| 67 | // behavior can build with the IMATH_USE_NOEXCEPT off. |
| 68 | // |
| 69 | |
| 70 | #define IMATH_USE_NOEXCEPT 1 |
| 71 | #if IMATH_USE_NOEXCEPT |
| 72 | #define IMATH_NOEXCEPT noexcept |
| 73 | #else |
| 74 | #define IMATH_NOEXCEPT |
| 75 | #endif |
| 76 | |
| 77 | // |
| 78 | // By default, opt into the interoparability constructors and assignments. |
| 79 | // If this causes problems, it can be disabled by defining this symbol to |
| 80 | // be 0 prior to including any Imath headers. |
| 81 | // |
| 82 | // If no such definition is found, we enable automatically unless we are |
| 83 | // using gcc 4.x, which appears to have bugs that prevent the interop |
| 84 | // templates from compiling correctly. |
| 85 | // |
| 86 | #ifndef IMATH_FOREIGN_VECTOR_INTEROP |
| 87 | # if defined(__GNUC__) && __GNUC__ == 4 && !defined(__clang__) |
| 88 | # define IMATH_FOREIGN_VECTOR_INTEROP 0 |
| 89 | # else |
| 90 | # define IMATH_FOREIGN_VECTOR_INTEROP 1 |
| 91 | # endif |
| 92 | #endif |
| 93 | |
| 94 | |
| 95 | // |
| 96 | // Decorator that makes a function available for both CPU and GPU, when |
| 97 | // compiling for Cuda. |
| 98 | // |
| 99 | #ifdef __CUDACC__ |
| 100 | #define IMATH_HOSTDEVICE __host__ __device__ |
| 101 | #else |
| 102 | #define IMATH_HOSTDEVICE |
| 103 | #endif |
| 104 | |
| 105 | |
| 106 | // |
| 107 | // Some compilers define a special intrinsic to use in conditionals that can |
| 108 | // speed up extremely performance-critical spots if the conditional is |
| 109 | // usually (or rarely) is true. You use it by replacing |
| 110 | // if (x) ... |
| 111 | // with |
| 112 | // if (IMATH_LIKELY(x)) ... // if you think x will usually be true |
| 113 | // or |
| 114 | // if (IMATH_UNLIKELY(x)) ... // if you think x will rarely be true |
| 115 | // |
| 116 | // Caveat: Programmers are notoriously bad at guessing this, so it should be |
| 117 | // used only with thorough benchmarking. |
| 118 | // |
| 119 | #if defined(__GNUC__) || defined(__clang__) || defined(__INTEL_COMPILER) |
| 120 | # ifdef __cplusplus |
| 121 | # define IMATH_LIKELY(x) (__builtin_expect(static_cast<bool>(x), true)) |
| 122 | # define IMATH_UNLIKELY(x) (__builtin_expect(static_cast<bool>(x), false)) |
| 123 | # else |
| 124 | # define IMATH_LIKELY(x) (__builtin_expect((x), 1)) |
| 125 | # define IMATH_UNLIKELY(x) (__builtin_expect((x), 0)) |
| 126 | # endif |
| 127 | #else |
| 128 | # define IMATH_LIKELY(x) (x) |
| 129 | # define IMATH_UNLIKELY(x) (x) |
| 130 | #endif |
| 131 | |
| 132 | |
| 133 | // On modern versions of gcc & clang, __has_attribute can test support for |
| 134 | // __attribute__((attr)). Make sure it's safe for other compilers. |
| 135 | #ifndef __has_attribute |
| 136 | # define __has_attribute(x) 0 |
| 137 | #endif |
| 138 | |
| 139 | |
| 140 | // |
| 141 | // Simple way to mark things as deprecated. |
| 142 | // When we are sure that C++14 is our true minimum, then we can just |
| 143 | // directly use [[deprecated(msg)]]. |
| 144 | // |
| 145 | #if defined(_MSC_VER) |
| 146 | # define IMATH_DEPRECATED(msg) __declspec(deprecated(msg)) |
| 147 | #elif defined(__cplusplus) && __cplusplus >= 201402L |
| 148 | # define IMATH_DEPRECATED(msg) [[deprecated(msg)]] |
| 149 | #elif defined(__GNUC__) || defined(__clang__) |
| 150 | # define IMATH_DEPRECATED(msg) __attribute__((deprecated(msg))) |
| 151 | #else |
| 152 | # define IMATH_DEPRECATED(msg) /* unsupported on this platform */ |
| 153 | #endif |
| 154 | |
| 155 | // Whether the user configured the library to have symbol visibility |
| 156 | // tagged |
| 157 | #define IMATH_ENABLE_API_VISIBILITY |
| 158 | |
| 159 | // MSVC does not do the same visibility attributes, and when we are |
| 160 | // compiling a static library we won't be in DLL mode, but just don't |
| 161 | // define these and the export headers will work out |
| 162 | #if ! defined(_MSC_VER) && defined(IMATH_ENABLE_API_VISIBILITY) |
| 163 | # define IMATH_PUBLIC_SYMBOL_ATTRIBUTE __attribute__ ((__visibility__ ("default"))) |
| 164 | # define IMATH_PRIVATE_SYMBOL_ATTRIBUTE __attribute__ ((__visibility__ ("hidden"))) |
| 165 | // clang differs from gcc and has type visibility which is needed for enums and templates |
| 166 | # if __has_attribute(__type_visibility__) |
| 167 | # define IMATH_PUBLIC_TYPE_VISIBILITY_ATTRIBUTE __attribute__ ((__type_visibility__ ("default"))) |
| 168 | # endif |
| 169 | #endif |
| 170 | |
| 171 | #endif // INCLUDED_IMATH_CONFIG_H |
| 172 | |