|
@@ -454,11 +454,24 @@ static_assert(sizeof(uint32) == 4, "Invalid size of uint32");
|
|
static_assert(sizeof(uint64) == 8, "Invalid size of uint64");
|
|
static_assert(sizeof(uint64) == 8, "Invalid size of uint64");
|
|
static_assert(sizeof(void *) == (JPH_CPU_ADDRESS_BITS == 64? 8 : 4), "Invalid size of pointer" );
|
|
static_assert(sizeof(void *) == (JPH_CPU_ADDRESS_BITS == 64? 8 : 4), "Invalid size of pointer" );
|
|
|
|
|
|
|
|
+// Determine if we want extra debugging code to be active
|
|
|
|
+#if !defined(NDEBUG) && !defined(JPH_NO_DEBUG)
|
|
|
|
+ #define JPH_DEBUG
|
|
|
|
+#endif
|
|
|
|
+
|
|
// Define inline macro
|
|
// Define inline macro
|
|
#if defined(JPH_NO_FORCE_INLINE)
|
|
#if defined(JPH_NO_FORCE_INLINE)
|
|
#define JPH_INLINE inline
|
|
#define JPH_INLINE inline
|
|
-#elif defined(JPH_COMPILER_CLANG) || defined(JPH_COMPILER_GCC)
|
|
|
|
|
|
+#elif defined(JPH_COMPILER_CLANG)
|
|
#define JPH_INLINE __inline__ __attribute__((always_inline))
|
|
#define JPH_INLINE __inline__ __attribute__((always_inline))
|
|
|
|
+#elif defined(JPH_COMPILER_GCC)
|
|
|
|
+ // On gcc 14 using always_inline in debug mode causes error: "inlining failed in call to 'always_inline' 'XXX': function not considered for inlining"
|
|
|
|
+ // See: https://github.com/jrouwe/JoltPhysics/issues/1096
|
|
|
|
+ #if __GNUC__ >= 14 && defined(JPH_DEBUG)
|
|
|
|
+ #define JPH_INLINE inline
|
|
|
|
+ #else
|
|
|
|
+ #define JPH_INLINE __inline__ __attribute__((always_inline))
|
|
|
|
+ #endif
|
|
#elif defined(JPH_COMPILER_MSVC)
|
|
#elif defined(JPH_COMPILER_MSVC)
|
|
#define JPH_INLINE __forceinline
|
|
#define JPH_INLINE __forceinline
|
|
#else
|
|
#else
|
|
@@ -482,11 +495,6 @@ static_assert(sizeof(void *) == (JPH_CPU_ADDRESS_BITS == 64? 8 : 4), "Invalid si
|
|
// Stack allocation
|
|
// Stack allocation
|
|
#define JPH_STACK_ALLOC(n) alloca(n)
|
|
#define JPH_STACK_ALLOC(n) alloca(n)
|
|
|
|
|
|
-// Determine if we want extra debugging code to be active
|
|
|
|
-#if !defined(NDEBUG) && !defined(JPH_NO_DEBUG)
|
|
|
|
- #define JPH_DEBUG
|
|
|
|
-#endif
|
|
|
|
-
|
|
|
|
// Shorthand for #ifdef JPH_DEBUG / #endif
|
|
// Shorthand for #ifdef JPH_DEBUG / #endif
|
|
#ifdef JPH_DEBUG
|
|
#ifdef JPH_DEBUG
|
|
#define JPH_IF_DEBUG(...) __VA_ARGS__
|
|
#define JPH_IF_DEBUG(...) __VA_ARGS__
|