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 #if defined (__clang_major__) 74 #define PX_CLANG_MAJOR __clang_major__ 75 #elif defined (_clang_major) 76 #define PX_CLANG_MAJOR _clang_major 78 #define PX_CLANG_MAJOR 0 80 #elif defined(__GNUC__) // note: __clang__ implies __GNUC__ 83 #error "Unknown compiler" 89 #if defined(_XBOX_ONE) 91 #elif defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP 93 #elif defined(_WIN64) // note: _XBOX_ONE implies _WIN64 95 #elif defined(_WIN32) // note: _M_PPC implies _WIN32 97 #elif defined(__ANDROID__) 99 #elif defined(__linux__) || defined (__EMSCRIPTEN__) // note: __ANDROID__ implies __linux__ 101 #elif defined(__APPLE__) && (defined(__arm__) || defined(__arm64__)) 103 #elif defined(__APPLE__) 105 #elif defined(__ORBIS__) 107 #elif defined(__NX__) 110 #error "Unknown operating system" 116 #if defined(__x86_64__) || defined(_M_X64) // ps4 compiler defines _M_X64 without value 118 #elif defined(__i386__) || defined(_M_IX86) || defined (__EMSCRIPTEN__) 120 #elif defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64) 122 #elif defined(__arm__) || defined(_M_ARM) 124 #elif defined(__ppc__) || defined(_M_PPC) || defined(__CELLOS_LV2__) 127 #error "Unknown architecture" 133 #if !defined(PX_SIMD_DISABLED) 134 #if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || (defined (__EMSCRIPTEN__) && defined(__SSE2__)) 137 #if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON) 140 #if defined(_M_PPC) || defined(__CELLOS_LV2__) 225 #define PX_DEBUG_CRT 0 238 #define PX_GCC_FAMILY (PX_CLANG || PX_GCC) 240 #define PX_WINDOWS_FAMILY (PX_WIN32 || PX_WIN64 || PX_UWP) 241 #define PX_MICROSOFT_FAMILY (PX_XBOXONE || PX_WINDOWS_FAMILY) 242 #define PX_LINUX_FAMILY (PX_LINUX || PX_ANDROID) 243 #define PX_APPLE_FAMILY (PX_IOS || PX_OSX) // equivalent to #if __APPLE__ 244 #define PX_UNIX_FAMILY (PX_LINUX_FAMILY || PX_APPLE_FAMILY) // shortcut for unix/posix platforms 245 #if defined(__EMSCRIPTEN__) 246 #define PX_EMSCRIPTEN 1 248 #define PX_EMSCRIPTEN 0 251 #define PX_INTEL_FAMILY (PX_X64 || PX_X86) 252 #define PX_ARM_FAMILY (PX_ARM || PX_A64) 253 #define PX_P64_FAMILY (PX_X64 || PX_A64) // shortcut for 64-bit architectures 258 #if defined(_LIBCPP_VERSION) || PX_WIN64 || PX_WIN32 || PX_PS4 || PX_XBOXONE || PX_UWP || PX_EMSCRIPTEN 265 #define PX_WINDOWS (PX_WINDOWS_FAMILY && !PX_ARM_FAMILY) 270 #ifndef PX_ENABLE_ASSERTS 271 #if PX_DEBUG && !defined(__CUDACC__) 272 #define PX_ENABLE_ASSERTS 1 274 #define PX_ENABLE_ASSERTS 0 282 #if PX_WINDOWS_FAMILY || PX_LINUX 283 #define PX_C_EXPORT extern "C" 289 #if PX_UNIX_FAMILY&& __GNUC__ >= 4 290 #define PX_UNIX_EXPORT __attribute__((visibility("default"))) 292 #define PX_UNIX_EXPORT 295 #if (PX_WINDOWS_FAMILY || PX_XBOXONE || PX_PS4) 296 #define PX_DLL_EXPORT __declspec(dllexport) 297 #define PX_DLL_IMPORT __declspec(dllimport) 299 #define PX_DLL_EXPORT PX_UNIX_EXPORT 300 #define PX_DLL_IMPORT 307 #if PX_MICROSOFT_FAMILY 308 #define PX_CALL_CONV __cdecl 318 #define PX_PUSH_PACK_DEFAULT __pragma(pack(push, 8)) 319 #define PX_POP_PACK __pragma(pack(pop)) 321 #define PX_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)") 322 #define PX_POP_PACK _Pragma("pack(pop)") 324 #define PX_PUSH_PACK_DEFAULT 331 #define PX_INLINE inline 332 #if PX_MICROSOFT_FAMILY 333 #pragma inline_depth(255) 340 #define PX_FORCE_INLINE __forceinline 341 #elif PX_LINUX // Workaround; Fedora Core 3 do not agree with force inline and PxcPool 342 #define PX_FORCE_INLINE inline 344 #define PX_FORCE_INLINE inline __attribute__((always_inline)) 346 #define PX_FORCE_INLINE inline 352 #if PX_MICROSOFT_FAMILY 353 #define PX_NOINLINE __declspec(noinline) 355 #define PX_NOINLINE __attribute__((noinline)) 363 #if defined(__CUDACC__) 364 #define PX_RESTRICT __restrict__ 366 #define PX_RESTRICT __restrict 372 #if PX_MICROSOFT_FAMILY 373 #define PX_NOALIAS __declspec(noalias) 390 #if PX_MICROSOFT_FAMILY 391 #define PX_ALIGN(alignment, decl) __declspec(align(alignment)) decl 392 #define PX_ALIGN_PREFIX(alignment) __declspec(align(alignment)) 393 #define PX_ALIGN_SUFFIX(alignment) 395 #define PX_ALIGN(alignment, decl) decl __attribute__((aligned(alignment))) 396 #define PX_ALIGN_PREFIX(alignment) 397 #define PX_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment))) 398 #elif defined __CUDACC__ 399 #define PX_ALIGN(alignment, decl) __align__(alignment) decl 400 #define PX_ALIGN_PREFIX(alignment) 401 #define PX_ALIGN_SUFFIX(alignment) __align__(alignment)) 403 #define PX_ALIGN(alignment, decl) 404 #define PX_ALIGN_PREFIX(alignment) 405 #define PX_ALIGN_SUFFIX(alignment) 419 #define PX_DEPRECATED 426 #if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_SWITCH) || (PX_CLANG && PX_ARM) 427 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PX_CONCAT(PxCompileTimeAssert_Dummy, __COUNTER__)[(exp) ? 1 : -1] __attribute__((unused)) 429 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1] 433 #define PX_OFFSET_OF(X, Y) __builtin_offsetof(X, Y) 435 #define PX_OFFSET_OF(X, Y) offsetof(X, Y) 438 #define PX_OFFSETOF_BASE 0x100 // casting the null ptr takes a special-case code path, which we don't want 439 #define PX_OFFSET_OF_RT(Class, Member) \ 440 (reinterpret_cast<size_t>(&reinterpret_cast<Class*>(PX_OFFSETOF_BASE)->Member) - size_t(PX_OFFSETOF_BASE)) 443 #if !defined(NDEBUG) ^ defined(_DEBUG) 444 #error Exactly one of NDEBUG and _DEBUG needs to be defined! 448 #if !PX_CHECKED && PX_DEBUG 449 #error PX_CHECKED must be defined when PX_DEBUG is defined 453 #define PX_CUDA_CALLABLE __host__ __device__ 455 #define PX_CUDA_CALLABLE 470 #if PX_PS4 || PX_APPLE_FAMILY || (PX_CLANG && !PX_ARM) 476 #elif PX_ANDROID || (PX_CLANG && PX_ARM) 490 #if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN && !(PX_CLANG && PX_X86) 496 #define PX_DUMMY_SYMBOL \ 499 char PxDummySymbol; \ 502 #define PX_DUMMY_SYMBOL 506 #define PX_WEAK_SYMBOL __attribute__((weak)) // this is to support SIMD constant merging in template specialization 508 #define PX_WEAK_SYMBOL 513 #define PX_NOCOPY(Class) \ 516 Class(const Class&); \ 517 Class& operator=(const Class&); 519 #ifndef DISABLE_CUDA_PHYSX 521 #define PX_SUPPORT_GPU_PHYSX ((PX_WINDOWS_FAMILY) || (PX_LINUX && PX_X64)) 523 #define PX_SUPPORT_GPU_PHYSX 0 526 #define PX_SUPPORT_COMPUTE_PHYSX 0 528 #ifndef PX_SUPPORT_EXTERN_TEMPLATE 529 #define PX_SUPPORT_EXTERN_TEMPLATE ((!PX_ANDROID) && (PX_VC != 11)) 531 #define PX_SUPPORT_EXTERN_TEMPLATE 0 535 #endif // #ifndef PXFOUNDATION_PXPREPROCESSOR_H Definition: PxPreprocessor.h:483
#define PX_OFFSET_OF(X, Y)
Definition: PxPreprocessor.h:435
#define PX_COMPILE_TIME_ASSERT(exp)
Definition: PxPreprocessor.h:429
PX_CUDA_CALLABLE PX_INLINE void PX_UNUSED(T const &)
Definition: PxPreprocessor.h:461
long long a
Definition: PxPreprocessor.h:486
char _
Definition: PxPreprocessor.h:485
#define PX_INLINE
Definition: PxPreprocessor.h:331
#define PX_CUDA_CALLABLE
Definition: PxPreprocessor.h:455