31 #define CP_EXPORT __declspec(dllexport)
42 #ifndef CP_ALLOW_PRIVATE_ACCESS
43 #define CP_ALLOW_PRIVATE_ACCESS 0
46 #if CP_ALLOW_PRIVATE_ACCESS == 1
47 #define CP_PRIVATE(__symbol__) __symbol__
49 #define CP_PRIVATE(__symbol__) __symbol__##_private
52 CP_EXPORT
void cpMessage(
const char *condition,
const char *file,
int line,
int isError,
int isHardError,
const char *message, ...);
54 #define cpAssertWarn(__condition__, ...)
55 #define cpAssertSoft(__condition__, ...)
57 #define cpAssertSoft(__condition__, ...) if(!(__condition__)){cpMessage(#__condition__, __FILE__, __LINE__, 1, 0, __VA_ARGS__); abort();}
58 #define cpAssertWarn(__condition__, ...) if(!(__condition__)) cpMessage(#__condition__, __FILE__, __LINE__, 0, 0, __VA_ARGS__)
62 #define cpAssertHard(__condition__, ...) if(!(__condition__)){cpMessage(#__condition__, __FILE__, __LINE__, 1, 1, __VA_ARGS__); abort();}
64 #include "chipmunk_types.h"
70 #ifndef CP_BUFFER_BYTES
71 #define CP_BUFFER_BYTES (32*1024)
76 #define cpcalloc calloc
81 #define cprealloc realloc
90 typedef struct cpHashSet cpHashSet;
109 typedef struct cpSimpleMotorJoint cpSimpleMotorJoint;
119 #include "cpTransform.h"
120 #include "cpSpatialIndex.h"
122 #include "cpArbiter.h"
126 #include "cpPolyShape.h"
128 #include "cpConstraint.h"
133 #define CP_VERSION_MAJOR 7
134 #define CP_VERSION_MINOR 0
135 #define CP_VERSION_RELEASE 1
185 #define CP_CONVEX_HULL(__count__, __verts__, __count_var__, __verts_var__) \
186 cpVect *__verts_var__ = (cpVect *)alloca(__count__*sizeof(cpVect)); \
187 int __count_var__ = cpConvexHull(__count__, __verts__, __verts_var__, NULL, 0.0); \
198 #if defined(__has_extension)
199 #if __has_extension(blocks)
204 void cpSpaceEachBody_b(
cpSpace *space,
void (^block)(
cpBody *body));
205 void cpSpaceEachShape_b(
cpSpace *space,
void (^block)(
cpShape *shape));
208 void cpBodyEachShape_b(
cpBody *body,
void (^block)(
cpShape *shape));
210 void cpBodyEachArbiter_b(
cpBody *body,
void (^block)(
cpArbiter *arbiter));
218 typedef void (^cpSpaceBBQueryBlock)(
cpShape *shape);