aboutsummaryrefslogtreecommitdiff
path: root/PxShared/include
diff options
context:
space:
mode:
authorSheikh Dawood Abdul Ajees <[email protected]>2017-09-15 15:41:57 -0500
committerSheikh Dawood Abdul Ajees <[email protected]>2017-09-15 15:41:57 -0500
commitd1c812f1162e5fdb13c215792725b2591d7428f5 (patch)
tree407056c45c7e9320c48fca6a3697d81a061c4ea0 /PxShared/include
parentPhysX 3.4, APEX 1.4 patch release @22121272 (diff)
downloadphysx-3.4-3.4.1.tar.xz
physx-3.4-3.4.1.zip
PhysX 3.4.1, APEX 1.4.1 Release @22845541v3.4.1
Diffstat (limited to 'PxShared/include')
-rw-r--r--PxShared/include/foundation/PxFoundation.h11
-rw-r--r--PxShared/include/foundation/PxIntrinsics.h4
-rw-r--r--PxShared/include/foundation/PxPreprocessor.h15
-rw-r--r--PxShared/include/foundation/PxSimpleTypes.h2
-rw-r--r--PxShared/include/foundation/unix/PxUnixIntrinsics.h16
5 files changed, 33 insertions, 15 deletions
diff --git a/PxShared/include/foundation/PxFoundation.h b/PxShared/include/foundation/PxFoundation.h
index 8642c16d..aae84a9a 100644
--- a/PxShared/include/foundation/PxFoundation.h
+++ b/PxShared/include/foundation/PxFoundation.h
@@ -126,7 +126,18 @@ PxCreateFoundation(physx::PxU32 version, physx::PxAllocatorCallback& allocator,
@see PxCreateFoundation()
*/
+#if PX_CLANG
+#if PX_LINUX
+ #pragma clang diagnostic push
+ #pragma clang diagnostic ignored "-Wreturn-type-c-linkage"
+#endif // PX_LINUX
+#endif // PX_CLANG
PX_C_EXPORT PX_FOUNDATION_API physx::PxFoundation& PX_CALL_CONV PxGetFoundation();
+#if PX_CLANG
+#if PX_LINUX
+ #pragma clang diagnostic pop
+#endif // PX_LINUX
+#endif // PX_CLANG
namespace physx
{
diff --git a/PxShared/include/foundation/PxIntrinsics.h b/PxShared/include/foundation/PxIntrinsics.h
index 471f934c..b4aff283 100644
--- a/PxShared/include/foundation/PxIntrinsics.h
+++ b/PxShared/include/foundation/PxIntrinsics.h
@@ -38,8 +38,8 @@
#include "foundation/unix/PxUnixIntrinsics.h"
#elif PX_XBOXONE
#include "foundation/XboxOne/PxXboxOneIntrinsics.h"
-#elif PX_NX
-#include "foundation/nx/PxNXIntrinsics.h"
+#elif PX_SWITCH
+#include "foundation/switch/PxSwitchIntrinsics.h"
#else
#error "Platform not supported!"
#endif
diff --git a/PxShared/include/foundation/PxPreprocessor.h b/PxShared/include/foundation/PxPreprocessor.h
index 7921217d..ddbf2584 100644
--- a/PxShared/include/foundation/PxPreprocessor.h
+++ b/PxShared/include/foundation/PxPreprocessor.h
@@ -47,7 +47,9 @@ All definitions have a value of 1 or 0, use '#if' instead of '#ifdef'.
Compiler defines, see http://sourceforge.net/p/predef/wiki/Compilers/
*/
#if defined(_MSC_VER)
-#if _MSC_VER >= 1900
+#if _MSC_VER >= 1910
+#define PX_VC 15
+#elif _MSC_VER >= 1900
#define PX_VC 14
#elif _MSC_VER >= 1800
#define PX_VC 12
@@ -88,7 +90,7 @@ Operating system defines, see http://sourceforge.net/p/predef/wiki/OperatingSyst
#elif defined(__ORBIS__)
#define PX_PS4 1
#elif defined(__NX__)
-#define PX_NX 1
+#define PX_SWITCH 1
#else
#error "Unknown operating system"
#endif
@@ -161,8 +163,8 @@ define anything not defined on this platform to 0
#ifndef PX_PS4
#define PX_PS4 0
#endif
-#ifndef PX_NX
-#define PX_NX 0
+#ifndef PX_SWITCH
+#define PX_SWITCH 0
#endif
#ifndef PX_X64
#define PX_X64 0
@@ -425,7 +427,7 @@ General defines
*/
// static assert
-#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_NX) || (PX_CLANG && PX_ARM)
+#if(defined(__GNUC__) && (__GNUC__ > 4 || (__GNUC__ == 4 && __GNUC_MINOR__ >= 7))) || (PX_PS4) || (PX_APPLE_FAMILY) || (PX_SWITCH) || (PX_CLANG && PX_ARM)
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1] __attribute__((unused))
#else
#define PX_COMPILE_TIME_ASSERT(exp) typedef char PxCompileTimeAssert_Dummy[(exp) ? 1 : -1]
@@ -488,7 +490,8 @@ struct PxPackValidation
long long a;
};
#endif
-#if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN
+// clang (as of version 3.9) cannot align doubles on 8 byte boundary when compiling for Intel 32 bit target
+#if !PX_APPLE_FAMILY && !PX_EMSCRIPTEN && !(PX_CLANG && PX_X86)
PX_COMPILE_TIME_ASSERT(PX_OFFSET_OF(PxPackValidation, a) == 8);
#endif
diff --git a/PxShared/include/foundation/PxSimpleTypes.h b/PxShared/include/foundation/PxSimpleTypes.h
index 6ecba13e..655fbb36 100644
--- a/PxShared/include/foundation/PxSimpleTypes.h
+++ b/PxShared/include/foundation/PxSimpleTypes.h
@@ -56,7 +56,7 @@
#if PX_VC // we could use inttypes.h starting with VC12
#define PX_PRIu64 "I64u"
#else
-#if !PX_PS4 && !PX_APPLE_FAMILY
+#if !PX_PS4 && !PX_APPLE_FAMILY && !PX_SWITCH
#define __STDC_FORMAT_MACROS
#endif
#include <inttypes.h>
diff --git a/PxShared/include/foundation/unix/PxUnixIntrinsics.h b/PxShared/include/foundation/unix/PxUnixIntrinsics.h
index 351c83c1..e076113f 100644
--- a/PxShared/include/foundation/unix/PxUnixIntrinsics.h
+++ b/PxShared/include/foundation/unix/PxUnixIntrinsics.h
@@ -37,11 +37,12 @@
#error "This file should only be included by Unix builds!!"
#endif
-#if PX_LINUX && !defined(__CUDACC__)
- // Linux and CUDA compilation does not work with std::isfnite, as it is not marked as CUDA callable
- #ifndef isfinite
- #define isfinite std::isfinite
- #endif
+#if (PX_LINUX || PX_ANDROID) && !defined(__CUDACC__) && !PX_EMSCRIPTEN
+ // Linux/android and CUDA compilation does not work with std::isfnite, as it is not marked as CUDA callable
+ #include <cmath>
+ #ifndef isfinite
+ using std::isfinite;
+ #endif
#endif
#include <math.h>
@@ -125,7 +126,10 @@ PX_CUDA_CALLABLE PX_FORCE_INLINE float selectMax(float a, float b)
//! \brief platform-specific finiteness check (not INF or NAN)
PX_CUDA_CALLABLE PX_FORCE_INLINE bool isFinite(float a)
{
- return !!isfinite(a);
+ //std::isfinite not recommended as of Feb 2017, since it doesn't work with g++/clang's floating point optimization.
+ union localU { PxU32 i; float f; } floatUnion;
+ floatUnion.f = a;
+ return !((floatUnion.i & 0x7fffffff) >= 0x7f800000);
}
//! \brief platform-specific finiteness check (not INF or NAN)