31 #elif defined(__FreeBSD__)
39 #define CP_EXPORT __declspec(dllexport)
48 CP_EXPORT
void cpMessage(
const char *condition,
const char *file,
int line,
int isError,
int isHardError,
const char *message, ...);
50 #define cpAssertWarn(__condition__, ...)
51 #define cpAssertSoft(__condition__, ...)
53 #define cpAssertSoft(__condition__, ...) if(!(__condition__)){cpMessage(#__condition__, __FILE__, __LINE__, 1, 0, __VA_ARGS__); abort();}
54 #define cpAssertWarn(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__)
58 #define cpAssertHard(__condition__, ...) if(!(__condition__)){cpMessage(#__condition__, __FILE__, __LINE__, 1, 1, __VA_ARGS__); abort();}
60 #include "chipmunk_types.h"
66 #ifndef CP_BUFFER_BYTES
67 #define CP_BUFFER_BYTES (32*1024)
72 #define cpcalloc calloc
77 #define cprealloc realloc
86 typedef struct cpHashSet cpHashSet;
105 typedef struct cpSimpleMotorJoint cpSimpleMotorJoint;
115 #include "cpTransform.h"
116 #include "cpSpatialIndex.h"
118 #include "cpArbiter.h"
122 #include "cpPolyShape.h"
124 #include "cpConstraint.h"
129 #define CP_VERSION_MAJOR 7
130 #define CP_VERSION_MINOR 0
131 #define CP_VERSION_RELEASE 3
177 #define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \
178 cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \
179 int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \
190 #if defined(__has_extension)
191 #if __has_extension(blocks)
196 void cpSpaceEachBody_b(
cpSpace *space,
void (^block)(
cpBody *body));
197 void cpSpaceEachShape_b(
cpSpace *space,
void (^block)(
cpShape *shape));
200 void cpBodyEachShape_b(
cpBody *body,
void (^block)(
cpShape *shape));
202 void cpBodyEachArbiter_b(
cpBody *body,
void (^block)(
cpArbiter *arbiter));
210 typedef void (^cpSpaceBBQueryBlock)(
cpShape *shape);