0001-bullet-namespace.patch 6.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214
  1. diff --git a/thirdparty/vhacd/inc/btAlignedAllocator.h b/thirdparty/vhacd/inc/btAlignedAllocator.h
  2. index 11f6e12dc..94e71d512 100644
  3. --- a/thirdparty/vhacd/inc/btAlignedAllocator.h
  4. +++ b/thirdparty/vhacd/inc/btAlignedAllocator.h
  5. @@ -21,6 +21,11 @@ subject to the following restrictions:
  6. ///that is better portable and more predictable
  7. #include "btScalar.h"
  8. +
  9. +// -- GODOT start --
  10. +namespace VHACD {
  11. +// -- GODOT end --
  12. +
  13. //#define BT_DEBUG_MEMORY_ALLOCATIONS 1
  14. #ifdef BT_DEBUG_MEMORY_ALLOCATIONS
  15. @@ -101,4 +106,8 @@ public:
  16. friend bool operator==(const self_type&, const self_type&) { return true; }
  17. };
  18. +// -- GODOT start --
  19. +}; // namespace VHACD
  20. +// -- GODOT end --
  21. +
  22. #endif //BT_ALIGNED_ALLOCATOR
  23. diff --git a/thirdparty/vhacd/inc/btAlignedObjectArray.h b/thirdparty/vhacd/inc/btAlignedObjectArray.h
  24. index e6620adf6..1ce03d21b 100644
  25. --- a/thirdparty/vhacd/inc/btAlignedObjectArray.h
  26. +++ b/thirdparty/vhacd/inc/btAlignedObjectArray.h
  27. @@ -38,6 +38,10 @@ subject to the following restrictions:
  28. #include <new> //for placement new
  29. #endif //BT_USE_PLACEMENT_NEW
  30. +// -- GODOT start --
  31. +namespace VHACD {
  32. +// -- GODOT end --
  33. +
  34. ///The btAlignedObjectArray template class uses a subset of the stl::vector interface for its methods
  35. ///It is developed to replace stl::vector to avoid portability issues, including STL alignment issues to add SIMD/SSE data
  36. template <typename T>
  37. @@ -445,4 +449,8 @@ public:
  38. }
  39. };
  40. +// -- GODOT start --
  41. +}; // namespace VHACD
  42. +// -- GODOT end --
  43. +
  44. #endif //BT_OBJECT_ARRAY__
  45. diff --git a/thirdparty/vhacd/inc/btConvexHullComputer.h b/thirdparty/vhacd/inc/btConvexHullComputer.h
  46. index 3c5075c2c..04bb96f64 100644
  47. --- a/thirdparty/vhacd/inc/btConvexHullComputer.h
  48. +++ b/thirdparty/vhacd/inc/btConvexHullComputer.h
  49. @@ -18,6 +18,10 @@ subject to the following restrictions:
  50. #include "btAlignedObjectArray.h"
  51. #include "btVector3.h"
  52. +// -- GODOT start --
  53. +namespace VHACD {
  54. +// -- GODOT end --
  55. +
  56. /// Convex hull implementation based on Preparata and Hong
  57. /// See http://code.google.com/p/bullet/issues/detail?id=275
  58. /// Ole Kniemeyer, MAXON Computer GmbH
  59. @@ -94,4 +98,8 @@ public:
  60. }
  61. };
  62. +// -- GODOT start --
  63. +}; // namespace VHACD
  64. +// -- GODOT end --
  65. +
  66. #endif //BT_CONVEX_HULL_COMPUTER_H
  67. diff --git a/thirdparty/vhacd/inc/btMinMax.h b/thirdparty/vhacd/inc/btMinMax.h
  68. index 40b0ceb6e..9bc1e1c77 100644
  69. --- a/thirdparty/vhacd/inc/btMinMax.h
  70. +++ b/thirdparty/vhacd/inc/btMinMax.h
  71. @@ -17,6 +17,10 @@ subject to the following restrictions:
  72. #include "btScalar.h"
  73. +// -- GODOT start --
  74. +namespace VHACD {
  75. +// -- GODOT end --
  76. +
  77. template <class T>
  78. SIMD_FORCE_INLINE const T& btMin(const T& a, const T& b)
  79. {
  80. @@ -62,4 +66,8 @@ SIMD_FORCE_INLINE void btClamp(T& a, const T& lb, const T& ub)
  81. }
  82. }
  83. +// -- GODOT start --
  84. +}; // namespace VHACD
  85. +// -- GODOT end --
  86. +
  87. #endif //BT_GEN_MINMAX_H
  88. diff --git a/thirdparty/vhacd/inc/btScalar.h b/thirdparty/vhacd/inc/btScalar.h
  89. index b814474bd..617fd7c44 100644
  90. --- a/thirdparty/vhacd/inc/btScalar.h
  91. +++ b/thirdparty/vhacd/inc/btScalar.h
  92. @@ -28,11 +28,19 @@ subject to the following restrictions:
  93. /* SVN $Revision$ on $Date$ from http://bullet.googlecode.com*/
  94. #define BT_BULLET_VERSION 279
  95. +// -- GODOT start --
  96. +namespace VHACD {
  97. +// -- GODOT end --
  98. +
  99. inline int32_t btGetVersion()
  100. {
  101. return BT_BULLET_VERSION;
  102. }
  103. +// -- GODOT start --
  104. +}; // namespace VHACD
  105. +// -- GODOT end --
  106. +
  107. #if defined(DEBUG) || defined(_DEBUG)
  108. #define BT_DEBUG
  109. #endif
  110. @@ -199,6 +207,10 @@ inline int32_t btGetVersion()
  111. #endif //__CELLOS_LV2__
  112. #endif
  113. +// -- GODOT start --
  114. +namespace VHACD {
  115. +// -- GODOT end --
  116. +
  117. ///The btScalar type abstracts floating point numbers, to easily switch between double and single floating point precision.
  118. #if defined(BT_USE_DOUBLE_PRECISION)
  119. typedef double btScalar;
  120. @@ -530,4 +542,9 @@ struct btTypedObject {
  121. return m_objectType;
  122. }
  123. };
  124. +
  125. +// -- GODOT start --
  126. +}; // namespace VHACD
  127. +// -- GODOT end --
  128. +
  129. #endif //BT_SCALAR_H
  130. diff --git a/thirdparty/vhacd/inc/btVector3.h b/thirdparty/vhacd/inc/btVector3.h
  131. index 0f2fefbbd..4ed971673 100644
  132. --- a/thirdparty/vhacd/inc/btVector3.h
  133. +++ b/thirdparty/vhacd/inc/btVector3.h
  134. @@ -26,6 +26,10 @@ subject to the following restrictions:
  135. #define btVector3DataName "btVector3FloatData"
  136. #endif //BT_USE_DOUBLE_PRECISION
  137. +// -- GODOT start --
  138. +namespace VHACD {
  139. +// -- GODOT end --
  140. +
  141. /**@brief btVector3 can be used to represent 3D points and vectors.
  142. * It has an un-used w component to suit 16-byte alignment when btVector3 is stored in containers. This extra component can be used by derived classes (Quaternion?) or by user
  143. * Ideally, this class should be replaced by a platform optimized SIMD version that keeps the data in registers
  144. @@ -712,4 +716,8 @@ SIMD_FORCE_INLINE void btVector3::deSerialize(const struct btVector3Data& dataIn
  145. m_floats[i] = dataIn.m_floats[i];
  146. }
  147. +// -- GODOT start --
  148. +}; // namespace VHACD
  149. +// -- GODOT end --
  150. +
  151. #endif //BT_VECTOR3_H
  152. diff --git a/thirdparty/vhacd/src/btAlignedAllocator.cpp b/thirdparty/vhacd/src/btAlignedAllocator.cpp
  153. index 11d594f6c..ce0e7f26f 100644
  154. --- a/thirdparty/vhacd/src/btAlignedAllocator.cpp
  155. +++ b/thirdparty/vhacd/src/btAlignedAllocator.cpp
  156. @@ -15,6 +15,10 @@ subject to the following restrictions:
  157. #include "btAlignedAllocator.h"
  158. +// -- GODOT start --
  159. +namespace VHACD {
  160. +// -- GODOT end --
  161. +
  162. #ifdef _MSC_VER
  163. #pragma warning(disable:4311 4302)
  164. #endif
  165. @@ -177,4 +181,8 @@ void btAlignedFreeInternal(void* ptr)
  166. sAlignedFreeFunc(ptr);
  167. }
  168. +// -- GODOT start --
  169. +}; // namespace VHACD
  170. +// -- GODOT end --
  171. +
  172. #endif //BT_DEBUG_MEMORY_ALLOCATIONS
  173. diff --git a/thirdparty/vhacd/src/btConvexHullComputer.cpp b/thirdparty/vhacd/src/btConvexHullComputer.cpp
  174. index d3d749adb..8ab34af2a 100644
  175. --- a/thirdparty/vhacd/src/btConvexHullComputer.cpp
  176. +++ b/thirdparty/vhacd/src/btConvexHullComputer.cpp
  177. @@ -49,6 +49,10 @@ typedef unsigned long long int32_t uint64_t;
  178. #include <stdio.h>
  179. #endif
  180. +// -- GODOT start --
  181. +namespace VHACD {
  182. +// -- GODOT end --
  183. +
  184. // Convex hull implementation based on Preparata and Hong
  185. // Ole Kniemeyer, MAXON Computer GmbH
  186. class btConvexHullInternal {
  187. @@ -2477,3 +2481,7 @@ btScalar btConvexHullComputer::compute(const void* coords, bool doubleCoords, in
  188. return shift;
  189. }
  190. +
  191. +// -- GODOT start --
  192. +}; // namespace VHACD
  193. +// -- GODOT end --