Go to the documentation of this file.
14 #ifndef PX_FOUNDATION_PX_PREPROCESSOR_H
15 #define PX_FOUNDATION_PX_PREPROCESSOR_H
39 # elif _MSC_VER >= 1800
41 # elif _MSC_VER >= 1700
43 # elif _MSC_VER >= 1600
45 # elif _MSC_VER >= 1500
47 # elif _MSC_VER >= 1400
49 # elif _MSC_VER >= 1300
54 #elif defined(__ghs__)
56 #elif __GNUC__ || __SNC__
59 # error "Unknown compiler"
69 # elif defined(_M_IX86)
72 # elif defined(_M_X64)
75 # elif defined(_M_PPC)
79 # elif defined(_M_ARM)
83 # error "Unknown platform"
85 # if defined(WINAPI_FAMILY) && (WINAPI_FAMILY == WINAPI_PARTITION_APP)
89 # ifdef __CELLOS_LV2__
92 # elif defined(__arm__)
97 # if defined(__ARM_NEON__)
100 # elif defined(__arm64__)
102 # if defined(__ARM_NEON__)
105 # elif defined(__i386__)
108 # elif defined(__x86_64__)
115 # elif defined(__ppc__)
117 # elif defined(__ppc64__)
121 # error "Unknown platform"
123 # if defined(ANDROID)
126 # elif defined(__linux__)
129 # elif defined(__APPLE__)
132 # if defined(__arm__) || defined(__arm64__)
133 # define PX_APPLE_IOS
137 # elif defined(__CYGWIN__)
146 #if defined(PX_X64) || defined(PX_A64)
147 #define PX_P64 // pointers are 64 bit
153 #if !defined(PX_C_EXPORT)
154 # if defined(PX_WINDOWS) || defined(PX_WINMODERN) || defined(PX_LINUX)
155 # define PX_C_EXPORT extern "C"
161 #if (defined(PX_UNIX) && (__GNUC__ >= 4))
162 # define PX_UNIX_EXPORT __attribute__ ((visibility ("default")))
164 # define PX_UNIX_EXPORT
176 #if (defined(PX_WINDOWS) || defined(PX_WINMODERN) ) && !defined(__CUDACC__)
177 #if defined PX_FOUNDATION_EXPORTS
178 #define PX_FOUNDATION_API __declspec(dllexport)
179 #elif defined PX_FOUNDATION_NO_EXPORTS
180 #define PX_FOUNDATION_API
182 #define PX_FOUNDATION_API __declspec(dllimport)
184 #elif defined(PX_UNIX)
185 #define PX_FOUNDATION_API PX_UNIX_EXPORT
187 #define PX_FOUNDATION_API
194 # if defined PX_WINDOWS
195 # define PX_CALL_CONV __cdecl
197 # define PX_CALL_CONV
205 # define PX_PUSH_PACK_DEFAULT __pragma( pack(push, 8) )
206 # define PX_POP_PACK __pragma( pack(pop) )
207 #elif (defined(PX_GNUC) && !defined(__SPU__)) || defined(PX_GHS)
208 # define PX_PUSH_PACK_DEFAULT _Pragma("pack(push, 8)")
209 # define PX_POP_PACK _Pragma("pack(pop)")
211 # define PX_PUSH_PACK_DEFAULT
218 #if defined(PX_WINDOWS) || defined(PX_X360) || defined(PX_WINMODERN) || defined(PX_XBOXONE)
219 # define PX_INLINE inline
220 # pragma inline_depth( 255 )
222 # define PX_INLINE inline
229 #define PX_FORCE_INLINE __forceinline
230 #elif defined(PX_LINUX) // Workaround; Fedora Core 3 do not agree with force inline and PxcPool
231 #define PX_FORCE_INLINE inline
232 #elif defined(PX_GNUC) || defined(PX_GHS)
233 #define PX_FORCE_INLINE inline __attribute__((always_inline))
235 #define PX_FORCE_INLINE inline
241 #if defined PX_WINDOWS || defined PX_XBOXONE
242 # define PX_NOINLINE __declspec(noinline)
243 #elif defined(PX_GNUC) || defined(PX_GHS)
244 # define PX_NOINLINE __attribute__ ((noinline))
250 #if defined(__CUDACC__)
251 # define PX_RESTRICT __restrict__
254 # define PX_RESTRICT __restrict
257 #if defined(PX_WINDOWS) || defined(PX_X360) || defined(PX_WINMODERN) || defined(PX_XBOXONE)
258 #define PX_NOALIAS __declspec(noalias)
277 #define PX_ALIGN(alignment, decl) __declspec(align(alignment)) decl
278 #define PX_ALIGN_PREFIX(alignment) __declspec(align(alignment))
279 #define PX_ALIGN_SUFFIX(alignment)
280 #elif defined(PX_GNUC) || defined(PX_GHS) || defined(PX_APPLE_IOS)
281 #define PX_ALIGN(alignment, decl) decl __attribute__ ((aligned(alignment)))
282 #define PX_ALIGN_PREFIX(alignment)
283 #define PX_ALIGN_SUFFIX(alignment) __attribute__ ((aligned(alignment)))
285 #define PX_ALIGN(alignment, decl)
286 #define PX_ALIGN_PREFIX(alignment)
287 #define PX_ALIGN_SUFFIX(alignment)
296 #if 0 // set to 1 to create warnings for deprecated functions
297 # define PX_DEPRECATED __declspec(deprecated)
299 # define PX_DEPRECATED
303 #if defined PX_VC6 && !defined __FUNCTION__
304 # define __FUNCTION__ "Undefined"
312 #if defined(__GNUC__) && ((__GNUC__ > 4) || ((__GNUC__ == 4) && (__GNUC_MINOR__ >= 7)))
313 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1] __attribute__((unused))
315 #define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1]
319 #define PX_OFFSET_OF(X, Y) __builtin_offsetof(X, Y)
321 #define PX_OFFSET_OF(X, Y) offsetof(X, Y)
324 #define PX_SIZE_OF(Class, Member) sizeof(((Class*)0)->Member)
327 #if !(defined NDEBUG ^ defined _DEBUG)
328 #error Exactly one of NDEBUG and _DEBUG needs to be defined by preprocessor
332 #if !defined(PX_CHECKED) && defined _DEBUG
337 #define PX_CUDA_CALLABLE __host__ __device__
339 #define PX_CUDA_CALLABLE
343 #if (defined(PX_WINDOWS) && !defined(PX_WINMODERN) && !defined(PX_VC14)) || defined(PX_LINUX)
344 #define PX_SUPPORT_GPU_PHYSX 1
346 #define PX_SUPPORT_GPU_PHYSX 0
361 #if !defined(PX_APPLE)
367 #define PX_DUMMY_SYMBOL namespace { char PxDummySymbol; }
369 #define PX_DUMMY_SYMBOL
385 #define PX_IS_WINDOWS 1
387 #define PX_IS_WINDOWS 0
402 #if defined(PX_X86) || defined(PX_X64)
403 #define PX_IS_INTEL 1
405 #define PX_IS_INTEL 0
426 #define PX_IS_PPU (PX_IS_PS3 && !PX_IS_SPU) // PS3 PPU
429 #define PX_WEAK_SYMBOL __attribute__((weak)) // this is to support SIMD constant merging in template specialization
431 #define PX_WEAK_SYMBOL
435 #endif // PX_FOUNDATION_PX_PREPROCESSOR_H
Copyright © 2008-2015 NVIDIA Corporation, 2701 San Tomas Expressway, Santa Clara, CA 95050 U.S.A. All rights reserved. www.nvidia.com