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)
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__)
83#error "Unknown compiler"
91#elif defined(_GAMING_XBOX) || defined (_GAMING_XBOX_SCARLETT)
92#define PX_XBOX_SERIES_X 1
93#elif defined(WINAPI_FAMILY) && WINAPI_FAMILY == WINAPI_FAMILY_APP
99#elif defined(__ANDROID__)
101#elif defined(__linux__) || defined (__EMSCRIPTEN__)
103#elif defined(__APPLE__) && (defined(__arm__) || defined(__arm64__))
105#elif defined(__APPLE__)
107#elif defined(__ORBIS__)
112#error "Unknown operating system"
118#if defined(__x86_64__) || defined(_M_X64)
120#elif defined(__i386__) || defined(_M_IX86) || defined (__EMSCRIPTEN__)
122#elif defined(__arm64__) || defined(__aarch64__) || defined(_M_ARM64)
124#elif defined(__arm__) || defined(_M_ARM)
126#elif defined(__ppc__) || defined(_M_PPC) || defined(__CELLOS_LV2__)
129#error "Unknown architecture"
135#if !defined(PX_SIMD_DISABLED)
136#if defined(__i386__) || defined(_M_IX86) || defined(__x86_64__) || defined(_M_X64) || (defined (__EMSCRIPTEN__) && defined(__SSE2__))
139#if defined(_M_ARM) || defined(__ARM_NEON__) || defined(__ARM_NEON)
142#if defined(_M_PPC) || defined(__CELLOS_LV2__)
162#ifndef PX_XBOX_SERIES_X
163#define PX_XBOX_SERIES_X 0
230#define PX_DEBUG_CRT 0
243#define PX_GCC_FAMILY (PX_CLANG || PX_GCC)
245#define PX_WINDOWS_FAMILY (PX_WIN32 || PX_WIN64 || PX_UWP)
246#define PX_MICROSOFT_FAMILY (PX_XBOXONE || PX_WINDOWS_FAMILY || PX_XBOX_SERIES_X)
247#define PX_LINUX_FAMILY (PX_LINUX || PX_ANDROID)
248#define PX_APPLE_FAMILY (PX_IOS || PX_OSX)
249#define PX_UNIX_FAMILY (PX_LINUX_FAMILY || PX_APPLE_FAMILY)
250#if defined(__EMSCRIPTEN__)
251#define PX_EMSCRIPTEN 1
253#define PX_EMSCRIPTEN 0
256#define PX_INTEL_FAMILY (PX_X64 || PX_X86)
257#define PX_ARM_FAMILY (PX_ARM || PX_A64)
258#define PX_P64_FAMILY (PX_X64 || PX_A64)
263#if defined(_LIBCPP_VERSION) || PX_WIN64 || PX_WIN32 || PX_PS4 || PX_XBOXONE || PX_UWP || PX_EMSCRIPTEN || PX_XBOX_SERIES_X
270#define PX_WINDOWS (PX_WINDOWS_FAMILY && !PX_ARM_FAMILY)
275#ifndef PX_ENABLE_ASSERTS
276#if PX_DEBUG && !defined(__CUDACC__)
277#define PX_ENABLE_ASSERTS 1
279#define PX_ENABLE_ASSERTS 0
287#if PX_WINDOWS_FAMILY || PX_LINUX
288#define PX_C_EXPORT extern "C"
294#if PX_UNIX_FAMILY&& __GNUC__ >= 4
295#define PX_UNIX_EXPORT __attribute__((visibility("default")))
297#define PX_UNIX_EXPORT
300#if (PX_WINDOWS_FAMILY || PX_XBOXONE || PX_PS4 || PX_XBOX_SERIES_X)
301#define PX_DLL_EXPORT __declspec(dllexport)
302#define PX_DLL_IMPORT __declspec(dllimport)
304#define PX_DLL_EXPORT PX_UNIX_EXPORT
312#if PX_MICROSOFT_FAMILY
313#define PX_CALL_CONV __cdecl
323#define PX_PUSH_PACK_DEFAULT __pragma(pack(push, 8))
324#define PX_POP_PACK __pragma(pack(pop))
326#define PX_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)")
327#define PX_POP_PACK _Pragma("pack(pop)")
329#define PX_PUSH_PACK_DEFAULT
336#define PX_INLINE inline
337#if PX_MICROSOFT_FAMILY
338#pragma inline_depth(255)
345#define PX_FORCE_INLINE __forceinline
347#define PX_FORCE_INLINE inline
349#define PX_FORCE_INLINE inline __attribute__((always_inline))
351#define PX_FORCE_INLINE inline
357#if PX_MICROSOFT_FAMILY
358#define PX_NOINLINE __declspec(noinline)
360#define PX_NOINLINE __attribute__((noinline))
368#if defined(__CUDACC__)
369#define PX_RESTRICT __restrict__
371#define PX_RESTRICT __restrict
377#if PX_MICROSOFT_FAMILY
378#define PX_NOALIAS __declspec(noalias)
395#if PX_MICROSOFT_FAMILY
396#define PX_ALIGN(alignment, decl) __declspec(align(alignment)) decl
397#define PX_ALIGN_PREFIX(alignment) __declspec(align(alignment))
398#define PX_ALIGN_SUFFIX(alignment)
400#define PX_ALIGN(alignment, decl) decl __attribute__((aligned(alignment)))
401#define PX_ALIGN_PREFIX(alignment)
402#define PX_ALIGN_SUFFIX(alignment) __attribute__((aligned(alignment)))
403#elif defined __CUDACC__
404#define PX_ALIGN(alignment, decl) __align__(alignment) decl
405#define PX_ALIGN_PREFIX(alignment)
406#define PX_ALIGN_SUFFIX(alignment) __align__(alignment))
408#define PX_ALIGN(alignment, decl)
409#define PX_ALIGN_PREFIX(alignment)
410#define PX_ALIGN_SUFFIX(alignment)
431#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_SWITCH) || (PX_CLANG && PX_ARM)
432#define PX_COMPILE_TIME_ASSERT(exp) typedef char PX_CONCAT(PxCompileTimeAssert_Dummy, __COUNTER__)[(exp) ? 1 : -1] __attribute__((unused))
434#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1]
438#define PX_OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
440#define PX_OFFSET_OF(X, Y) offsetof(X, Y)
443#define PX_OFFSETOF_BASE 0x100
444#define PX_OFFSET_OF_RT(Class, Member) \
445 (reinterpret_cast<size_t>(&reinterpret_cast<Class*>(PX_OFFSETOF_BASE)->Member) - size_t(PX_OFFSETOF_BASE))
448#if !defined(NDEBUG) ^ defined(_DEBUG)
449#error Exactly one of NDEBUG and _DEBUG needs to be defined!
453#if !PX_CHECKED && PX_DEBUG
454#error PX_CHECKED must be defined when PX_DEBUG is defined
458#define PX_CUDA_CALLABLE __host__ __device__
460#define PX_CUDA_CALLABLE
466PX_CUDA_CALLABLE
PX_INLINE void PX_UNUSED(T
const&)
475#if PX_PS4 || PX_APPLE_FAMILY || (PX_CLANG && !PX_ARM)
481#elif PX_ANDROID || (PX_CLANG && PX_ARM)
495#if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN && !(PX_CLANG && PX_X86)
501#define PX_DUMMY_SYMBOL \
504 char PxDummySymbol; \
507#define PX_DUMMY_SYMBOL
511#define PX_WEAK_SYMBOL __attribute__((weak))
513#define PX_WEAK_SYMBOL
518#define PX_NOCOPY(Class) \
521 Class(const Class&); \
522 Class& operator=(const Class&);
524#ifndef DISABLE_CUDA_PHYSX
526#define PX_SUPPORT_GPU_PHYSX ((PX_WINDOWS_FAMILY) || (PX_LINUX && PX_X64))
528#define PX_SUPPORT_GPU_PHYSX 0
531#define PX_SUPPORT_COMPUTE_PHYSX 0
533#ifndef PX_SUPPORT_EXTERN_TEMPLATE
534#define PX_SUPPORT_EXTERN_TEMPLATE ((!PX_ANDROID) && (PX_VC != 11))
536#define PX_SUPPORT_EXTERN_TEMPLATE 0
#define PX_COMPILE_TIME_ASSERT(exp)
Definition PxPreprocessor.h:428
#define PX_INLINE
Definition PxPreprocessor.h:320
Definition PxPreprocessor.h:482