30 #ifndef PXFOUNDATION_PXPREPROCESSOR_H 31 #define PXFOUNDATION_PXPREPROCESSOR_H 34 #if !defined(PX_GENERATE_META_DATA) 41 #define PX_STRINGIZE_HELPER(X) #X 42 #define PX_STRINGIZE(X) PX_STRINGIZE_HELPER(X) 44 #define PX_CONCAT_HELPER(X, Y) X##Y 45 #define PX_CONCAT(X, Y) PX_CONCAT_HELPER(X, Y) 58 #elif _MSC_VER >= 1900 60 #elif _MSC_VER >= 1800 62 #elif _MSC_VER >= 1700 64 #elif _MSC_VER >= 1600 66 #elif _MSC_VER >= 1500 69 #error "Unknown VC version" 71 #elif defined(__clang__) 73 #elif defined(__GNUC__) // note: __clang__ implies __GNUC__ 76 #error "Unknown compiler" 82 #if defined(_XBOX_ONE) 84 #elif defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP 86 #elif defined(_WIN64) // note: _XBOX_ONE implies _WIN64 88 #elif defined(_WIN32) // note: _M_PPC implies _WIN32 90 #elif defined(__ANDROID__) 92 #elif defined(__linux__) || defined (__EMSCRIPTEN__) // note: __ANDROID__ implies __linux__ 94 #elif defined(__APPLE__) && (defined(__arm__) || defined(__arm64__)) 96 #elif defined(__APPLE__) 98 #elif defined(__ORBIS__) 100 #elif defined(__NX__) 103 #error "Unknown operating system" 109 #if defined(__x86_64__) || defined(_M_X64) // ps4 compiler defines _M_X64 without value 111 #elif defined(__i386__) || defined(_M_IX86) || defined (__EMSCRIPTEN__) 113 #elif defined(__arm64__) || defined(__aarch64__) 115 #elif defined(__arm__) || defined(_M_ARM) 117 #elif defined(__ppc__) || defined(_M_PPC) || defined(__CELLOS_LV2__) 120 #error "Unknown architecture" 126 #if !defined(PX_SIMD_DISABLED) 127 #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || (defined (__EMSCRIPTEN__) && defined(__SSE2__)) 130 #if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON) 133 #if defined(_M_PPC) || defined(__CELLOS_LV2__) 218 #define PX_DEBUG_CRT 0 231 #define PX_GCC_FAMILY (PX_CLANG || PX_GCC) 233 #define PX_WINDOWS_FAMILY (PX_WIN32 || PX_WIN64 || PX_UWP) 234 #define PX_MICROSOFT_FAMILY (PX_XBOXONE || PX_WINDOWS_FAMILY) 235 #define PX_LINUX_FAMILY (PX_LINUX || PX_ANDROID) 236 #define PX_APPLE_FAMILY (PX_IOS || PX_OSX) // equivalent to #if __APPLE__ 237 #define PX_UNIX_FAMILY (PX_LINUX_FAMILY || PX_APPLE_FAMILY) // shortcut for unix/posix platforms 238 #if defined(__EMSCRIPTEN__) 239 #define PX_EMSCRIPTEN 1 241 #define PX_EMSCRIPTEN 0 244 #define PX_INTEL_FAMILY (PX_X64 || PX_X86) 245 #define PX_ARM_FAMILY (PX_ARM || PX_A64) 246 #define PX_P64_FAMILY (PX_X64 || PX_A64) // shortcut for 64-bit architectures 251 #if defined(_LIBCPP_VERSION) || PX_WIN64 || PX_WIN32 || PX_PS4 || PX_XBOXONE || PX_UWP || PX_EMSCRIPTEN 258 #define PX_WINDOWS (PX_WINDOWS_FAMILY && !PX_ARM_FAMILY) 263 #ifndef PX_ENABLE_ASSERTS 264 #if PX_DEBUG && !defined(__CUDACC__) 265 #define PX_ENABLE_ASSERTS 1 267 #define PX_ENABLE_ASSERTS 0 275 #if PX_WINDOWS_FAMILY || PX_LINUX 276 #define PX_C_EXPORT extern "C" 282 #if PX_UNIX_FAMILY&& __GNUC__ >= 4 283 #define PX_UNIX_EXPORT __attribute__((visibility("default"))) 285 #define PX_UNIX_EXPORT 288 #if PX_WINDOWS_FAMILY 289 #define PX_DLL_EXPORT __declspec(dllexport) 290 #define PX_DLL_IMPORT __declspec(dllimport) 292 #define PX_DLL_EXPORT PX_UNIX_EXPORT 293 #define PX_DLL_IMPORT 305 #if PX_WINDOWS_FAMILY && !PX_ARM_FAMILY 306 #ifndef PX_FOUNDATION_DLL 307 #define PX_FOUNDATION_API PX_DLL_IMPORT 308 #elif PX_FOUNDATION_DLL 309 #define PX_FOUNDATION_API PX_DLL_EXPORT 312 #ifdef PX_FOUNDATION_DLL 313 #define PX_FOUNDATION_API PX_UNIX_EXPORT 317 #ifndef PX_FOUNDATION_API 318 #define PX_FOUNDATION_API 325 #if PX_MICROSOFT_FAMILY 326 #define PX_CALL_CONV __cdecl 336 #define PX_PUSH_PACK_DEFAULT __pragma(pack(push, 8)) 337 #define PX_POP_PACK __pragma(pack(pop)) 339 #define PX_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)") 340 #define PX_POP_PACK _Pragma("pack(pop)") 342 #define PX_PUSH_PACK_DEFAULT 349 #define PX_INLINE inline 350 #if PX_MICROSOFT_FAMILY 351 #pragma inline_depth(255) 358 #define PX_FORCE_INLINE __forceinline 359 #elif PX_LINUX // Workaround; Fedora Core 3 do not agree with force inline and PxcPool 360 #define PX_FORCE_INLINE inline 362 #define PX_FORCE_INLINE inline __attribute__((always_inline)) 364 #define PX_FORCE_INLINE inline 370 #if PX_MICROSOFT_FAMILY 371 #define PX_NOINLINE __declspec(noinline) 373 #define PX_NOINLINE __attribute__((noinline)) 381 #if defined(__CUDACC__) 382 #define PX_RESTRICT __restrict__ 384 #define PX_RESTRICT __restrict 390 #if PX_MICROSOFT_FAMILY 391 #define PX_NOALIAS __declspec(noalias) 408 #if PX_MICROSOFT_FAMILY 409 #define PX_ALIGN(alignment, decl) __declspec(align(alignment)) decl 410 #define PX_ALIGN_PREFIX(alignment) __declspec(align(alignment)) 411 #define PX_ALIGN_SUFFIX(alignment) 413 #define PX_ALIGN(alignment, decl) decl __attribute__((aligned(alignment))) 414 #define PX_ALIGN_PREFIX(alignment) 415 #define PX_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment))) 416 #elif defined __CUDACC__ 417 #define PX_ALIGN(alignment, decl) __align__(alignment) decl 418 #define PX_ALIGN_PREFIX(alignment) 419 #define PX_ALIGN_SUFFIX(alignment) __align__(alignment)) 421 #define PX_ALIGN(alignment, decl) 422 #define PX_ALIGN_PREFIX(alignment) 423 #define PX_ALIGN_SUFFIX(alignment) 437 #define PX_DEPRECATED 444 #if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_SWITCH) || (PX_CLANG && PX_ARM) 445 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PX_CONCAT(PxCompileTimeAssert_Dummy, __COUNTER__)[(exp) ? 1 : -1] __attribute__((unused)) 447 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1] 451 #define PX_OFFSET_OF(X, Y) __builtin_offsetof(X, Y) 453 #define PX_OFFSET_OF(X, Y) offsetof(X, Y) 456 #define PX_OFFSETOF_BASE 0x100 // casting the null ptr takes a special-case code path, which we don't want 457 #define PX_OFFSET_OF_RT(Class, Member) \ 458 (reinterpret_cast<size_t>(&reinterpret_cast<Class*>(PX_OFFSETOF_BASE)->Member) - size_t(PX_OFFSETOF_BASE)) 461 #if !defined(NDEBUG) ^ defined(_DEBUG) 462 #error Exactly one of NDEBUG and _DEBUG needs to be defined! 466 #if !PX_CHECKED && PX_DEBUG 467 #error PX_CHECKED must be defined when PX_DEBUG is defined 471 #define PX_CUDA_CALLABLE __host__ __device__ 473 #define PX_CUDA_CALLABLE 488 #if PX_PS4 || PX_APPLE_FAMILY || (PX_CLANG && !PX_ARM) 494 #elif PX_ANDROID || (PX_CLANG && PX_ARM) 508 #if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN && !(PX_CLANG && PX_X86) 514 #define PX_DUMMY_SYMBOL \ 517 char PxDummySymbol; \ 520 #define PX_DUMMY_SYMBOL 524 #define PX_WEAK_SYMBOL __attribute__((weak)) // this is to support SIMD constant merging in template specialization 526 #define PX_WEAK_SYMBOL 531 #define PX_NOCOPY(Class) \ 534 Class(const Class&); \ 535 Class& operator=(const Class&); 537 #ifndef DISABLE_CUDA_PHYSX 539 #define PX_SUPPORT_GPU_PHYSX ((PX_WINDOWS_FAMILY) || (PX_LINUX && PX_X64)) 541 #define PX_SUPPORT_GPU_PHYSX 0 544 #define PX_SUPPORT_COMPUTE_PHYSX 0 546 #ifndef PX_SUPPORT_EXTERN_TEMPLATE 547 #define PX_SUPPORT_EXTERN_TEMPLATE ((!PX_ANDROID) && (PX_VC != 11)) 549 #define PX_SUPPORT_EXTERN_TEMPLATE 0 553 #endif // #ifndef PXFOUNDATION_PXPREPROCESSOR_H Definition: PxPreprocessor.h:501
#define PX_OFFSET_OF(X, Y)
Definition: PxPreprocessor.h:453
#define PX_COMPILE_TIME_ASSERT(exp)
Definition: PxPreprocessor.h:447
PX_CUDA_CALLABLE PX_INLINE void PX_UNUSED(T const &)
Definition: PxPreprocessor.h:479
long long a
Definition: PxPreprocessor.h:504
char _
Definition: PxPreprocessor.h:503
#define PX_INLINE
Definition: PxPreprocessor.h:349
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:473