1 /* Copyright (c) 2013 Scott Lembcke and Howling Moon Software
3 * Permission is hereby granted, free of charge, to any person obtaining a copy
4 * of this software and associated documentation files (the "Software"), to deal
5 * in the Software without restriction, including without limitation the rights
6 * to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7 * copies of the Software, and to permit persons to whom the Software is
8 * furnished to do so, subject to the following conditions:
10 * The above copyright notice and this permission notice shall be included in
11 * all copies or substantial portions of the Software.
13 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16 * AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17 * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18 * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
24 // Create non static inlined copies of Chipmunk functions, useful for working with dynamic FFIs
25 // For many languages, it may be faster to reimplement these functions natively instead.
26 // Note: This file should only be included by chipmunk.c.
30 #define MAKE_REF(name) CP_EXPORT decltype(name) *_##name = name
32 #define MAKE_REF(name)
35 #define MAKE_REF(name) __typeof__(name) *_##name = name
42 MAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv()
53 MAKE_REF(cpvforangle);
56 MAKE_REF(cpvunrotate);
57 MAKE_REF(cpvlengthsq);
60 MAKE_REF(cpvnormalize);
62 MAKE_REF(cpvlerpconst);
72 MAKE_REF(cpflerpconst);
75 MAKE_REF(cpBBNewForExtents);
76 MAKE_REF(cpBBNewForCircle);
77 MAKE_REF(cpBBIntersects);
78 MAKE_REF(cpBBContainsBB);
79 MAKE_REF(cpBBContainsVect);
84 MAKE_REF(cpBBMergedArea);
85 MAKE_REF(cpBBSegmentQuery);
86 MAKE_REF(cpBBIntersectsSegment);
87 MAKE_REF(cpBBClampVect);
89 MAKE_REF(cpSpatialIndexDestroy);
90 MAKE_REF(cpSpatialIndexCount);
91 MAKE_REF(cpSpatialIndexEach);
92 MAKE_REF(cpSpatialIndexContains);
93 MAKE_REF(cpSpatialIndexInsert);
94 MAKE_REF(cpSpatialIndexRemove);
95 MAKE_REF(cpSpatialIndexReindex);
96 MAKE_REF(cpSpatialIndexReindexObject);
97 MAKE_REF(cpSpatialIndexSegmentQuery);
98 MAKE_REF(cpSpatialIndexQuery);
99 MAKE_REF(cpSpatialIndexReindexQuery);