diff --git a/include/chipmunk/chipmunk.h b/include/chipmunk/chipmunk.h index d98ba7ea..2b06e4bc 100644 --- a/include/chipmunk/chipmunk.h +++ b/include/chipmunk/chipmunk.h @@ -36,7 +36,15 @@ #endif #ifdef _WIN32 - #define CP_EXPORT __declspec(dllexport) + #ifdef CHIPMUNK_SHARED + #ifdef CHIPMUNK_BUILD + #define CP_EXPORT __declspec(dllexport) + #else + #define CP_EXPORT __declspec(dllimport) + #endif + #else + #define CP_EXPORT + #endif #else #define CP_EXPORT #endif @@ -111,7 +119,10 @@ typedef struct cpArbiter cpArbiter; typedef struct cpSpace cpSpace; #include "cpVect.h" +#include "cpRobust.h" +#include "cpHastySpace.h" #include "cpBB.h" +#include "cpMarch.h" #include "cpTransform.h" #include "cpSpatialIndex.h" diff --git a/include/chipmunk/cpRobust.h b/include/chipmunk/cpRobust.h index e4b2c420..8c0fd362 100644 --- a/include/chipmunk/cpRobust.h +++ b/include/chipmunk/cpRobust.h @@ -5,7 +5,7 @@ // "Fast math" should be disabled here. // Check if c is to the left of segment (a, b). -cpBool cpCheckPointGreater(const cpVect a, const cpVect b, const cpVect c); +CP_EXPORT cpBool cpCheckPointGreater(const cpVect a, const cpVect b, const cpVect c); // Check if p is behind one of v0 or v1 on axis n. -cpBool cpCheckAxis(cpVect v0, cpVect v1, cpVect p, cpVect n); +CP_EXPORT cpBool cpCheckAxis(cpVect v0, cpVect v1, cpVect p, cpVect n); diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 34882d14..eff251d2 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -19,6 +19,8 @@ if(BUILD_SHARED) if(MSVC) set_source_files_properties(${chipmunk_source_files} PROPERTIES LANGUAGE CXX) set_target_properties(chipmunk PROPERTIES LINKER_LANGUAGE CXX) + target_compile_definitions(chipmunk PRIVATE CHIPMUNK_BUILD + PUBLIC CHIPMUNK_SHARED) endif(MSVC) # set the lib's version number # But avoid on Android because symlinks to version numbered .so's don't work with Android's Java-side loadLibrary. diff --git a/src/cpRobust.c b/src/cpRobust.c index 57507d14..91aa6823 100644 --- a/src/cpRobust.c +++ b/src/cpRobust.c @@ -1,4 +1,4 @@ -#include "chipmunk/cpRobust.h" +#include "chipmunk/chipmunk_private.h" cpBool