| 1 |
Description: Add header guards |
| 2 |
Author: Stephen Kitt <[email protected]> |
| 3 |
|
| 4 |
This adds header guards in all headers without guards, primarily to |
| 5 |
simplify automated analysis of the headers as a whole. |
| 6 |
|
| 7 |
--- a/include/chipmunk/cpArbiter.h |
| 8 |
+++ b/include/chipmunk/cpArbiter.h |
| 9 |
@@ -19,6 +19,9 @@ |
| 10 |
* SOFTWARE. |
| 11 |
*/ |
| 12 |
|
| 13 |
+#ifndef CP_ARBITER_H |
| 14 |
+#define CP_ARBITER_H |
| 15 |
+ |
| 16 |
/// @defgroup cpArbiter cpArbiter |
| 17 |
/// The cpArbiter struct tracks pairs of colliding shapes. |
| 18 |
/// They are also used in conjuction with collision handler callbacks |
| 19 |
@@ -143,3 +146,5 @@ |
| 20 |
CP_EXPORT void cpArbiterCallWildcardSeparateB(cpArbiter *arb, cpSpace *space); |
| 21 |
|
| 22 |
/// @} |
| 23 |
+ |
| 24 |
+#endif |
| 25 |
--- a/include/chipmunk/cpBody.h |
| 26 |
+++ b/include/chipmunk/cpBody.h |
| 27 |
@@ -19,6 +19,9 @@ |
| 28 |
* SOFTWARE. |
| 29 |
*/ |
| 30 |
|
| 31 |
+#ifndef CP_BODY_H |
| 32 |
+#define CP_BODY_H |
| 33 |
+ |
| 34 |
/// @defgroup cpBody cpBody |
| 35 |
/// Chipmunk's rigid body type. Rigid bodies hold the physical properties of an object like |
| 36 |
/// it's mass, and position and velocity of it's center of gravity. They don't have an shape on their own. |
| 37 |
@@ -187,3 +190,5 @@ |
| 38 |
CP_EXPORT void cpBodyEachArbiter(cpBody *body, cpBodyArbiterIteratorFunc func, void *data); |
| 39 |
|
| 40 |
///@} |
| 41 |
+ |
| 42 |
+#endif |
| 43 |
--- a/include/chipmunk/cpConstraint.h |
| 44 |
+++ b/include/chipmunk/cpConstraint.h |
| 45 |
@@ -19,6 +19,9 @@ |
| 46 |
* SOFTWARE. |
| 47 |
*/ |
| 48 |
|
| 49 |
+#ifndef CP_CONSTRAINT_H |
| 50 |
+#define CP_CONSTRAINT_H |
| 51 |
+ |
| 52 |
/// @defgroup cpConstraint cpConstraint |
| 53 |
/// @{ |
| 54 |
|
| 55 |
@@ -93,3 +96,5 @@ |
| 56 |
#include "cpSimpleMotor.h" |
| 57 |
|
| 58 |
///@} |
| 59 |
+ |
| 60 |
+#endif |
| 61 |
--- a/include/chipmunk/cpDampedRotarySpring.h |
| 62 |
+++ b/include/chipmunk/cpDampedRotarySpring.h |
| 63 |
@@ -19,6 +19,9 @@ |
| 64 |
* SOFTWARE. |
| 65 |
*/ |
| 66 |
|
| 67 |
+#ifndef CP_DAMPED_ROTARY_SPRING_H |
| 68 |
+#define CP_DAMPED_ROTARY_SPRING_H |
| 69 |
+ |
| 70 |
/// @defgroup cpDampedRotarySpring cpDampedRotarySpring |
| 71 |
/// @{ |
| 72 |
|
| 73 |
@@ -56,3 +59,5 @@ |
| 74 |
CP_EXPORT void cpDampedRotarySpringSetSpringTorqueFunc(cpConstraint *constraint, cpDampedRotarySpringTorqueFunc springTorqueFunc); |
| 75 |
|
| 76 |
/// @} |
| 77 |
+ |
| 78 |
+#endif |
| 79 |
--- a/include/chipmunk/cpDampedSpring.h |
| 80 |
+++ b/include/chipmunk/cpDampedSpring.h |
| 81 |
@@ -19,6 +19,9 @@ |
| 82 |
* SOFTWARE. |
| 83 |
*/ |
| 84 |
|
| 85 |
+#ifndef CP_DAMPED_SPRING_H |
| 86 |
+#define CP_DAMPED_SPRING_H |
| 87 |
+ |
| 88 |
/// @defgroup cpDampedSpring cpDampedSpring |
| 89 |
/// @{ |
| 90 |
|
| 91 |
@@ -66,3 +69,5 @@ |
| 92 |
CP_EXPORT void cpDampedSpringSetSpringForceFunc(cpConstraint *constraint, cpDampedSpringForceFunc springForceFunc); |
| 93 |
|
| 94 |
/// @} |
| 95 |
+ |
| 96 |
+#endif |
| 97 |
--- a/include/chipmunk/cpGearJoint.h |
| 98 |
+++ b/include/chipmunk/cpGearJoint.h |
| 99 |
@@ -19,6 +19,9 @@ |
| 100 |
* SOFTWARE. |
| 101 |
*/ |
| 102 |
|
| 103 |
+#ifndef CP_GEAR_JOINT_H |
| 104 |
+#define CP_GEAR_JOINT_H |
| 105 |
+ |
| 106 |
/// @defgroup cpGearJoint cpGearJoint |
| 107 |
/// @{ |
| 108 |
|
| 109 |
@@ -43,3 +46,5 @@ |
| 110 |
CP_EXPORT void cpGearJointSetRatio(cpConstraint *constraint, cpFloat ratio); |
| 111 |
|
| 112 |
/// @} |
| 113 |
+ |
| 114 |
+#endif |
| 115 |
--- a/include/chipmunk/cpGrooveJoint.h |
| 116 |
+++ b/include/chipmunk/cpGrooveJoint.h |
| 117 |
@@ -19,6 +19,9 @@ |
| 118 |
* SOFTWARE. |
| 119 |
*/ |
| 120 |
|
| 121 |
+#ifndef CP_GROOVE_JOINT_H |
| 122 |
+#define CP_GROOVE_JOINT_H |
| 123 |
+ |
| 124 |
/// @defgroup cpGrooveJoint cpGrooveJoint |
| 125 |
/// @{ |
| 126 |
|
| 127 |
@@ -48,3 +51,5 @@ |
| 128 |
CP_EXPORT void cpGrooveJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); |
| 129 |
|
| 130 |
/// @} |
| 131 |
+ |
| 132 |
+#endif |
| 133 |
--- a/include/chipmunk/cpHastySpace.h |
| 134 |
+++ b/include/chipmunk/cpHastySpace.h |
| 135 |
@@ -1,6 +1,9 @@ |
| 136 |
// Copyright 2013 Howling Moon Software. All rights reserved. |
| 137 |
// See http://chipmunk2d.net/legal.php for more information. |
| 138 |
|
| 139 |
+#ifndef CP_HASTY_SPACE_H |
| 140 |
+#define CP_HASTY_SPACE_H |
| 141 |
+ |
| 142 |
/// cpHastySpace is exclusive to Chipmunk Pro |
| 143 |
/// Currently it enables ARM NEON optimizations in the solver, but in the future will include other optimizations such as |
| 144 |
/// a multi-threaded solver and multi-threaded collision broadphases. |
| 145 |
@@ -25,3 +28,5 @@ |
| 146 |
|
| 147 |
/// When stepping a hasty space, you must use this function. |
| 148 |
CP_EXPORT void cpHastySpaceStep(cpSpace *space, cpFloat dt); |
| 149 |
+ |
| 150 |
+#endif |
| 151 |
--- a/include/chipmunk/cpMarch.h |
| 152 |
+++ b/include/chipmunk/cpMarch.h |
| 153 |
@@ -1,6 +1,9 @@ |
| 154 |
// Copyright 2013 Howling Moon Software. All rights reserved. |
| 155 |
// See http://chipmunk2d.net/legal.php for more information. |
| 156 |
|
| 157 |
+#ifndef CP_MARCH_H |
| 158 |
+#define CP_MARCH_H |
| 159 |
+ |
| 160 |
/// Function type used as a callback from the marching squares algorithm to sample an image function. |
| 161 |
/// It passes you the point to sample and your context pointer, and you return the density. |
| 162 |
typedef cpFloat (*cpMarchSampleFunc)(cpVect point, void *data); |
| 163 |
@@ -26,3 +29,5 @@ |
| 164 |
cpMarchSegmentFunc segment, void *segment_data, |
| 165 |
cpMarchSampleFunc sample, void *sample_data |
| 166 |
); |
| 167 |
+ |
| 168 |
+#endif |
| 169 |
--- a/include/chipmunk/cpPinJoint.h |
| 170 |
+++ b/include/chipmunk/cpPinJoint.h |
| 171 |
@@ -19,6 +19,9 @@ |
| 172 |
* SOFTWARE. |
| 173 |
*/ |
| 174 |
|
| 175 |
+#ifndef CP_PIN_JOINT_H |
| 176 |
+#define CP_PIN_JOINT_H |
| 177 |
+ |
| 178 |
/// @defgroup cpPinJoint cpPinJoint |
| 179 |
/// @{ |
| 180 |
|
| 181 |
@@ -48,3 +51,5 @@ |
| 182 |
CP_EXPORT void cpPinJointSetDist(cpConstraint *constraint, cpFloat dist); |
| 183 |
|
| 184 |
///@} |
| 185 |
+ |
| 186 |
+#endif |
| 187 |
--- a/include/chipmunk/cpPivotJoint.h |
| 188 |
+++ b/include/chipmunk/cpPivotJoint.h |
| 189 |
@@ -19,6 +19,9 @@ |
| 190 |
* SOFTWARE. |
| 191 |
*/ |
| 192 |
|
| 193 |
+#ifndef CP_PIVOT_JOINT_H |
| 194 |
+#define CP_PIVOT_JOINT_H |
| 195 |
+ |
| 196 |
/// @defgroup cpPivotJoint cpPivotJoint |
| 197 |
/// @{ |
| 198 |
|
| 199 |
@@ -45,3 +48,5 @@ |
| 200 |
CP_EXPORT void cpPivotJointSetAnchorB(cpConstraint *constraint, cpVect anchorB); |
| 201 |
|
| 202 |
/// @} |
| 203 |
+ |
| 204 |
+#endif |
| 205 |
--- a/include/chipmunk/cpPolyShape.h |
| 206 |
+++ b/include/chipmunk/cpPolyShape.h |
| 207 |
@@ -19,6 +19,9 @@ |
| 208 |
* SOFTWARE. |
| 209 |
*/ |
| 210 |
|
| 211 |
+#ifndef CP_POLY_SHAPE_H |
| 212 |
+#define CP_POLY_SHAPE_H |
| 213 |
+ |
| 214 |
/// @defgroup cpPolyShape cpPolyShape |
| 215 |
/// @{ |
| 216 |
|
| 217 |
@@ -54,3 +57,5 @@ |
| 218 |
CP_EXPORT cpFloat cpPolyShapeGetRadius(const cpShape *shape); |
| 219 |
|
| 220 |
/// @} |
| 221 |
+ |
| 222 |
+#endif |
| 223 |
--- a/include/chipmunk/cpPolyline.h |
| 224 |
+++ b/include/chipmunk/cpPolyline.h |
| 225 |
@@ -1,6 +1,9 @@ |
| 226 |
// Copyright 2013 Howling Moon Software. All rights reserved. |
| 227 |
// See http://chipmunk2d.net/legal.php for more information. |
| 228 |
|
| 229 |
+#ifndef CP_POLYLINES_H |
| 230 |
+#define CP_POLYLINES_H |
| 231 |
+ |
| 232 |
// Polylines are just arrays of vertexes. |
| 233 |
// They are looped if the first vertex is equal to the last. |
| 234 |
// cpPolyline structs are intended to be passed by value and destroyed when you are done with them. |
| 235 |
@@ -68,3 +71,5 @@ |
| 236 |
CP_EXPORT cpPolylineSet *cpPolylineConvexDecomposition(cpPolyline *line, cpFloat tol); |
| 237 |
|
| 238 |
#define cpPolylineConvexDecomposition_BETA cpPolylineConvexDecomposition |
| 239 |
+ |
| 240 |
+#endif |
| 241 |
--- a/include/chipmunk/cpRatchetJoint.h |
| 242 |
+++ b/include/chipmunk/cpRatchetJoint.h |
| 243 |
@@ -19,6 +19,9 @@ |
| 244 |
* SOFTWARE. |
| 245 |
*/ |
| 246 |
|
| 247 |
+#ifndef CP_RATCHET_JOINT_H |
| 248 |
+#define CP_RATCHET_JOINT_H |
| 249 |
+ |
| 250 |
/// @defgroup cpRatchetJoint cpRatchetJoint |
| 251 |
/// @{ |
| 252 |
|
| 253 |
@@ -48,3 +51,5 @@ |
| 254 |
CP_EXPORT void cpRatchetJointSetRatchet(cpConstraint *constraint, cpFloat ratchet); |
| 255 |
|
| 256 |
/// @} |
| 257 |
+ |
| 258 |
+#endif |
| 259 |
--- a/include/chipmunk/cpRobust.h |
| 260 |
+++ b/include/chipmunk/cpRobust.h |
| 261 |
@@ -1,3 +1,6 @@ |
| 262 |
+#ifndef CP_ROBUST_H |
| 263 |
+#define CP_ROBUST_H |
| 264 |
+ |
| 265 |
#include "chipmunk/cpVect.h" |
| 266 |
|
| 267 |
// This is a private header for functions (currently just one) that need strict floating point results. |
| 268 |
@@ -9,3 +12,5 @@ |
| 269 |
|
| 270 |
// Check if p is behind one of v0 or v1 on axis n. |
| 271 |
cpBool cpCheckAxis(cpVect v0, cpVect v1, cpVect p, cpVect n); |
| 272 |
+ |
| 273 |
+#endif |
| 274 |
--- a/include/chipmunk/cpRotaryLimitJoint.h |
| 275 |
+++ b/include/chipmunk/cpRotaryLimitJoint.h |
| 276 |
@@ -19,6 +19,9 @@ |
| 277 |
* SOFTWARE. |
| 278 |
*/ |
| 279 |
|
| 280 |
+#ifndef CP_ROTARY_LIMIT_JOINT_H |
| 281 |
+#define CP_ROTARY_LIMIT_JOINT_H |
| 282 |
+ |
| 283 |
/// @defgroup cpRotaryLimitJoint cpRotaryLimitJoint |
| 284 |
/// @{ |
| 285 |
|
| 286 |
@@ -43,3 +46,5 @@ |
| 287 |
CP_EXPORT void cpRotaryLimitJointSetMax(cpConstraint *constraint, cpFloat max); |
| 288 |
|
| 289 |
/// @} |
| 290 |
+ |
| 291 |
+#endif |
| 292 |
--- a/include/chipmunk/cpShape.h |
| 293 |
+++ b/include/chipmunk/cpShape.h |
| 294 |
@@ -19,6 +19,9 @@ |
| 295 |
* SOFTWARE. |
| 296 |
*/ |
| 297 |
|
| 298 |
+#ifndef CP_SHAPE_H |
| 299 |
+#define CP_SHAPE_H |
| 300 |
+ |
| 301 |
/// @defgroup cpShape cpShape |
| 302 |
/// The cpShape struct defines the shape of a rigid body. |
| 303 |
/// @{ |
| 304 |
@@ -197,3 +200,5 @@ |
| 305 |
CP_EXPORT cpFloat cpSegmentShapeGetRadius(const cpShape *shape); |
| 306 |
|
| 307 |
/// @} |
| 308 |
+ |
| 309 |
+#endif |
| 310 |
--- a/include/chipmunk/cpSimpleMotor.h |
| 311 |
+++ b/include/chipmunk/cpSimpleMotor.h |
| 312 |
@@ -19,6 +19,9 @@ |
| 313 |
* SOFTWARE. |
| 314 |
*/ |
| 315 |
|
| 316 |
+#ifndef CP_SIMPLE_MOTOR_H |
| 317 |
+#define CP_SIMPLE_MOTOR_H |
| 318 |
+ |
| 319 |
/// @defgroup cpSimpleMotor cpSimpleMotor |
| 320 |
/// @{ |
| 321 |
|
| 322 |
@@ -41,3 +44,5 @@ |
| 323 |
CP_EXPORT void cpSimpleMotorSetRate(cpConstraint *constraint, cpFloat rate); |
| 324 |
|
| 325 |
/// @} |
| 326 |
+ |
| 327 |
+#endif |
| 328 |
--- a/include/chipmunk/cpSlideJoint.h |
| 329 |
+++ b/include/chipmunk/cpSlideJoint.h |
| 330 |
@@ -19,6 +19,9 @@ |
| 331 |
* SOFTWARE. |
| 332 |
*/ |
| 333 |
|
| 334 |
+#ifndef CP_SLIDE_JOINT_H |
| 335 |
+#define CP_SLIDE_JOINT_H |
| 336 |
+ |
| 337 |
/// @defgroup cpSlideJoint cpSlideJoint |
| 338 |
/// @{ |
| 339 |
|
| 340 |
@@ -53,3 +56,5 @@ |
| 341 |
CP_EXPORT void cpSlideJointSetMax(cpConstraint *constraint, cpFloat max); |
| 342 |
|
| 343 |
/// @} |
| 344 |
+ |
| 345 |
+#endif |
| 346 |
--- a/include/chipmunk/cpSpace.h |
| 347 |
+++ b/include/chipmunk/cpSpace.h |
| 348 |
@@ -19,6 +19,9 @@ |
| 349 |
* SOFTWARE. |
| 350 |
*/ |
| 351 |
|
| 352 |
+#ifndef CP_SPACE_H |
| 353 |
+#define CP_SPACE_H |
| 354 |
+ |
| 355 |
/// @defgroup cpSpace cpSpace |
| 356 |
/// @{ |
| 357 |
|
| 358 |
@@ -317,3 +320,5 @@ |
| 359 |
#endif |
| 360 |
|
| 361 |
/// @} |
| 362 |
+ |
| 363 |
+#endif |
| 364 |
--- a/include/chipmunk/cpSpatialIndex.h |
| 365 |
+++ b/include/chipmunk/cpSpatialIndex.h |
| 366 |
@@ -19,6 +19,9 @@ |
| 367 |
* SOFTWARE. |
| 368 |
*/ |
| 369 |
|
| 370 |
+#ifndef CP_SPATIAL_INDEX_H |
| 371 |
+#define CP_SPATIAL_INDEX_H |
| 372 |
+ |
| 373 |
/** |
| 374 |
@defgroup cpSpatialIndex cpSpatialIndex |
| 375 |
|
| 376 |
@@ -225,3 +228,5 @@ |
| 377 |
} |
| 378 |
|
| 379 |
///@} |
| 380 |
+ |
| 381 |
+#endif |