Go to the documentation of this file. 6 #ifndef OPENVDB_PLATFORM_HAS_BEEN_INCLUDED 7 #define OPENVDB_PLATFORM_HAS_BEEN_INCLUDED 9 #define PRAGMA(x) _Pragma(#x) 14 #define OPENVDB_PREPROC_STRINGIFY_(x) #x 19 #define OPENVDB_PREPROC_STRINGIFY(x) OPENVDB_PREPROC_STRINGIFY_(x) 22 #define OPENVDB_PREPROC_CONCAT_(x, y) x ## y 27 #define OPENVDB_PREPROC_CONCAT(x, y) OPENVDB_PREPROC_CONCAT_(x, y) 32 #define OPENVDB_CHECK_GCC(MAJOR, MINOR) \ 33 (__GNUC__ > MAJOR || (__GNUC__ == MAJOR && __GNUC_MINOR__ >= MINOR)) 35 #define OPENVDB_CHECK_GCC(MAJOR, MINOR) 0 39 #define OPENVDB_HAS_CXX11 1 43 #if defined(OPENVDB_USE_SSE42) || defined(OPENVDB_USE_AVX) 46 #elif defined(__GNUC__) 47 #if defined(__x86_64__) || defined(__i386__) 48 #include <x86intrin.h> 49 #elif defined(__ARM_NEON__) 60 #ifndef _USE_MATH_DEFINES 61 #define _USE_MATH_DEFINES 70 #if defined(_DLL) && !defined(OPENVDB_STATICLIB) && !defined(OPENVDB_DLL) 76 #if !defined(OPENVDB_OPENEXR_STATICLIB) && !defined(OPENEXR_DLL) 96 #if defined(__INTEL_COMPILER) 100 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN \ 101 _Pragma("warning (push)") \ 102 _Pragma("warning (disable:111)") \ 103 _Pragma("warning (disable:128)") \ 104 _Pragma("warning (disable:185)") \ 105 _Pragma("warning (disable:280)") 106 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END \ 107 _Pragma("warning (pop)") 108 #elif defined(__clang__) 109 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN \ 110 PRAGMA(clang diagnostic push) \ 111 PRAGMA(clang diagnostic ignored "-Wunreachable-code") 112 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END \ 113 PRAGMA(clang diagnostic pop) 115 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_BEGIN 116 #define OPENVDB_NO_UNREACHABLE_CODE_WARNING_END 121 #ifndef OPENVDB_NO_DEPRECATION_WARNINGS 122 #define OPENVDB_DEPRECATED [[deprecated]] 123 #define OPENVDB_DEPRECATED_MESSAGE(msg) [[deprecated(msg)]] 125 #define OPENVDB_DEPRECATED 126 #define OPENVDB_DEPRECATED_MESSAGE(msg) 142 #if defined __INTEL_COMPILER 143 #define OPENVDB_NO_DEPRECATION_WARNING_BEGIN \ 144 _Pragma("warning (push)") \ 145 _Pragma("warning (disable:1478)") \ 146 PRAGMA(message("NOTE: ignoring deprecation warning at " __FILE__ \ 147 ":" OPENVDB_PREPROC_STRINGIFY(__LINE__))) 148 #define OPENVDB_NO_DEPRECATION_WARNING_END \ 149 _Pragma("warning (pop)") 150 #elif defined __clang__ 151 #define OPENVDB_NO_DEPRECATION_WARNING_BEGIN \ 152 _Pragma("clang diagnostic push") \ 153 _Pragma("clang diagnostic ignored \"-Wdeprecated-declarations\"") 155 #define OPENVDB_NO_DEPRECATION_WARNING_END \ 156 _Pragma("clang diagnostic pop") 157 #elif defined __GNUC__ 158 #define OPENVDB_NO_DEPRECATION_WARNING_BEGIN \ 159 _Pragma("GCC diagnostic push") \ 160 _Pragma("GCC diagnostic ignored \"-Wdeprecated-declarations\"") \ 161 _Pragma("message(\"NOTE: ignoring deprecation warning\")") 162 #define OPENVDB_NO_DEPRECATION_WARNING_END \ 163 _Pragma("GCC diagnostic pop") 164 #elif defined _MSC_VER 165 #define OPENVDB_NO_DEPRECATION_WARNING_BEGIN \ 166 __pragma(warning(push)) \ 167 __pragma(warning(disable : 4996)) \ 168 __pragma(message("NOTE: ignoring deprecation warning at " __FILE__ \ 169 ":" OPENVDB_PREPROC_STRINGIFY(__LINE__))) 170 #define OPENVDB_NO_DEPRECATION_WARNING_END \ 171 __pragma(warning(pop)) 173 #define OPENVDB_NO_DEPRECATION_WARNING_BEGIN 174 #define OPENVDB_NO_DEPRECATION_WARNING_END 188 #if defined __INTEL_COMPILER 189 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN 190 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_END 191 #elif defined __GNUC__ 193 #if OPENVDB_CHECK_GCC(4, 9) 194 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN \ 195 _Pragma("GCC diagnostic push") \ 196 _Pragma("GCC diagnostic ignored \"-Wconversion\"") \ 197 _Pragma("GCC diagnostic ignored \"-Wfloat-conversion\"") 199 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN \ 200 _Pragma("GCC diagnostic push") \ 201 _Pragma("GCC diagnostic ignored \"-Wconversion\"") 203 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_END \ 204 _Pragma("GCC diagnostic pop") 206 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_BEGIN 207 #define OPENVDB_NO_TYPE_CONVERSION_WARNING_END 211 #ifdef OPENVDB_EXPORT 212 #undef OPENVDB_EXPORT 214 #ifdef OPENVDB_IMPORT 215 #undef OPENVDB_IMPORT 218 #define OPENVDB_EXPORT __attribute__((visibility("default"))) 219 #define OPENVDB_IMPORT __attribute__((visibility("default"))) 223 #define OPENVDB_EXPORT __declspec(dllexport) 224 #define OPENVDB_IMPORT __declspec(dllimport) 226 #define OPENVDB_EXPORT 227 #define OPENVDB_IMPORT 232 #if defined(_WIN32) && defined(OPENVDB_DLL) 233 #ifdef OPENVDB_PRIVATE 234 #define OPENVDB_TEMPLATE_EXPORT OPENVDB_EXPORT 235 #define OPENVDB_TEMPLATE_IMPORT 237 #define OPENVDB_TEMPLATE_EXPORT 238 #define OPENVDB_TEMPLATE_IMPORT OPENVDB_IMPORT 241 #define OPENVDB_TEMPLATE_IMPORT 242 #define OPENVDB_TEMPLATE_EXPORT 251 #ifdef OPENVDB_PRIVATE 252 #define OPENVDB_API OPENVDB_EXPORT 254 #define OPENVDB_API OPENVDB_IMPORT 256 #ifdef OPENVDB_HOUDINI_API 257 #undef OPENVDB_HOUDINI_API 259 #ifdef OPENVDB_HOUDINI_PRIVATE 260 #define OPENVDB_HOUDINI_API OPENVDB_EXPORT 262 #define OPENVDB_HOUDINI_API OPENVDB_IMPORT 269 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710)) 270 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710)) 271 #define OPENVDB_START_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711)) 272 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711)) 273 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712)) 274 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712)) 278 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(disable:1710)) 279 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE __pragma(warning(default:1710)) 280 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE __pragma(warning(disable:1711)) 281 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE __pragma(warning(default:1711)) 282 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(disable:1712)) 283 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS __pragma(warning(default:1712)) 286 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) \ 287 __pragma(warning(disable:1710)); CODE; __pragma(warning(default:1710)) 288 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) \ 289 __pragma(warning(disable:1711)); CODE; __pragma(warning(default:1711)) 290 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) \ 291 __pragma(warning(disable:1712)); CODE; __pragma(warning(default:1712)) 293 #else // GCC does not support these compiler warnings 295 #define OPENVDB_START_THREADSAFE_STATIC_REFERENCE 296 #define OPENVDB_FINISH_THREADSAFE_STATIC_REFERENCE 297 #define OPENVDB_START_THREADSAFE_STATIC_WRITE 298 #define OPENVDB_FINISH_THREADSAFE_STATIC_WRITE 299 #define OPENVDB_START_THREADSAFE_STATIC_ADDRESS 300 #define OPENVDB_FINISH_THREADSAFE_STATIC_ADDRESS 302 #define OPENVDB_START_NON_THREADSAFE_STATIC_REFERENCE 303 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_REFERENCE 304 #define OPENVDB_START_NON_THREADSAFE_STATIC_WRITE 305 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_WRITE 306 #define OPENVDB_START_NON_THREADSAFE_STATIC_ADDRESS 307 #define OPENVDB_FINISH_NON_THREADSAFE_STATIC_ADDRESS 309 #define OPENVDB_THREADSAFE_STATIC_REFERENCE(CODE) CODE 310 #define OPENVDB_THREADSAFE_STATIC_WRITE(CODE) CODE 311 #define OPENVDB_THREADSAFE_STATIC_ADDRESS(CODE) CODE 313 #endif // defined(__ICC) 315 #endif // OPENVDB_PLATFORM_HAS_BEEN_INCLUDED