ImathConfig.h 5.3 KB

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