From 208bbe759470a56261efc1bd8eb10da69460c3c4 Mon Sep 17 00:00:00 2001 From: sjbaker Date: Tue, 26 Dec 2006 00:39:32 +0000 Subject: [PATCH] Added a set of empty, classless 'extern "C"' probe functions to allow '.so' loaders and application domain 'autotools' to easily and unambiguously check for the correct installation of the various bullet libraries. eg: bulletmath_suffix="-lbulletmath" bulletcollision_suffix="-lbulletcollision" bulletdynamics_suffix="-lbulletdynamics" dnl Check bulletmath library AC_CHECK_LIB(bulletmath, btBulletMathProbe, true, AC_MSG_ERROR([there seems to be a problem with the bulletmath library])) LIBS="$bulletmath_suffix $LIBS" dnl Check bulletcollision library AC_CHECK_LIB(bulletcollision, btBulletCollisionProbe, true, AC_MSG_ERROR([there seems to be a problem with the bulletcollision library])) LIBS="$bulletcollision_suffix $LIBS" dnl Check bulletdynamics library AC_CHECK_LIB(bulletdynamics, btBulletDynamicsProbe, true, AC_MSG_ERROR([there seems to be a problem with the bulletdynamics library])) LIBS="$bulletdynamics_suffix $LIBS" --- .../CollisionShapes/btCollisionShape.cpp | 10 ++++++++++ src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp | 8 ++++++++ src/LinearMath/btGeometryUtil.cpp | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/src/BulletCollision/CollisionShapes/btCollisionShape.cpp b/src/BulletCollision/CollisionShapes/btCollisionShape.cpp index cd5b56b37..81d82428f 100644 --- a/src/BulletCollision/CollisionShapes/btCollisionShape.cpp +++ b/src/BulletCollision/CollisionShapes/btCollisionShape.cpp @@ -15,6 +15,16 @@ subject to the following restrictions: #include "BulletCollision/CollisionShapes/btCollisionShape.h" + +/* + Make sure this dummy function never changes so that it + can be used by probes that are checking whether the + library is actually installed. +*/ +extern "C" void btBulletCollisionProbe () {} + + + void btCollisionShape::getBoundingSphere(btVector3& center,btScalar& radius) const { btTransform tr; diff --git a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp index d3a059df2..460564928 100644 --- a/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp +++ b/src/BulletDynamics/Dynamics/btSimpleDynamicsWorld.cpp @@ -22,6 +22,14 @@ subject to the following restrictions: #include "BulletDynamics/ConstraintSolver/btContactSolverInfo.h" +/* + Make sure this dummy function never changes so that it + can be used by probes that are checking whether the + library is actually installed. +*/ +extern "C" void btBulletDynamicsProbe () {} + + btSimpleDynamicsWorld::btSimpleDynamicsWorld(btDispatcher* dispatcher,btOverlappingPairCache* pairCache,btConstraintSolver* constraintSolver) diff --git a/src/LinearMath/btGeometryUtil.cpp b/src/LinearMath/btGeometryUtil.cpp index 8fc5d3963..283365698 100644 --- a/src/LinearMath/btGeometryUtil.cpp +++ b/src/LinearMath/btGeometryUtil.cpp @@ -16,6 +16,15 @@ subject to the following restrictions: #include "btGeometryUtil.h" + +/* + Make sure this dummy function never changes so that it + can be used by probes that are checking whether the + library is actually installed. +*/ +extern "C" void btBulletMathProbe () {} + + bool btGeometryUtil::isPointInsidePlanes(const btAlignedObjectArray& planeEquations, const btVector3& point, btScalar margin) { int numbrushes = planeEquations.size();