initial commit, 4.5 stable
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
Some checks failed
🔗 GHA / 📊 Static checks (push) Has been cancelled
🔗 GHA / 🤖 Android (push) Has been cancelled
🔗 GHA / 🍏 iOS (push) Has been cancelled
🔗 GHA / 🐧 Linux (push) Has been cancelled
🔗 GHA / 🍎 macOS (push) Has been cancelled
🔗 GHA / 🏁 Windows (push) Has been cancelled
🔗 GHA / 🌐 Web (push) Has been cancelled
This commit is contained in:
49
thirdparty/vhacd/patches/0002-fpermissive-fix.patch
vendored
Normal file
49
thirdparty/vhacd/patches/0002-fpermissive-fix.patch
vendored
Normal file
@@ -0,0 +1,49 @@
|
||||
diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h
|
||||
index 404bcbcfe1..db00a3c428 100644
|
||||
--- a/thirdparty/vhacd/inc/btScalar.h
|
||||
+++ b/thirdparty/vhacd/inc/btScalar.h
|
||||
@@ -537,6 +537,27 @@ struct btTypedObject {
|
||||
}
|
||||
};
|
||||
|
||||
+// Cherry-picked from Bullet 2.88 to fix GH-27926
|
||||
+///align a pointer to the provided alignment, upwards
|
||||
+template <typename T>
|
||||
+T *btAlignPointer(T *unalignedPtr, size_t alignment)
|
||||
+{
|
||||
+ struct btConvertPointerSizeT
|
||||
+ {
|
||||
+ union {
|
||||
+ T *ptr;
|
||||
+ size_t integer;
|
||||
+ };
|
||||
+ };
|
||||
+ btConvertPointerSizeT converter;
|
||||
+
|
||||
+ const size_t bit_mask = ~(alignment - 1);
|
||||
+ converter.ptr = unalignedPtr;
|
||||
+ converter.integer += alignment - 1;
|
||||
+ converter.integer &= bit_mask;
|
||||
+ return converter.ptr;
|
||||
+}
|
||||
+
|
||||
}; // namespace VHACD
|
||||
|
||||
#endif //BT_SCALAR_H
|
||||
diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp
|
||||
index bbb8baa107..4d7f4b1b2f 100644
|
||||
--- a/thirdparty/vhacd/src/btAlignedAllocator.cpp
|
||||
+++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp
|
||||
@@ -70,8 +70,10 @@ static inline void* btAlignedAllocDefault(size_t size, int32_t alignment)
|
||||
|
||||
real = (char*)sAllocFunc(size + sizeof(void*) + (alignment - 1));
|
||||
if (real) {
|
||||
- offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1);
|
||||
- ret = (void*)((real + sizeof(void*)) + offset);
|
||||
+ // Synced with Bullet 2.88 to fix GH-27926
|
||||
+ //offset = (alignment - (unsigned long)(real + sizeof(void*))) & (alignment - 1);
|
||||
+ //ret = (void*)((real + sizeof(void*)) + offset);
|
||||
+ ret = btAlignPointer(real + sizeof(void *), alignment);
|
||||
*((void**)(ret)-1) = (void*)(real);
|
||||
}
|
||||
else {
|
Reference in New Issue
Block a user