[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-physics / third-party / chipmunk2d / include / chipmunk / chipmunk_ffi.h
1 /* Copyright (c) 2013 Scott Lembcke and Howling Moon Software
2  * 
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:
9  * 
10  * The above copyright notice and this permission notice shall be included in
11  * all copies or substantial portions of the Software.
12  * 
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
19  * SOFTWARE.
20  */
21
22 #ifdef CHIPMUNK_FFI
23
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.
27
28 #ifdef _MSC_VER
29  #if _MSC_VER >= 1600
30   #define MAKE_REF(name) CP_EXPORT decltype(name) *_##name = name
31  #else
32   #define MAKE_REF(name)
33  #endif
34 #else
35  #define MAKE_REF(name) __typeof__(name) *_##name = name
36 #endif
37
38 #ifdef __cplusplus
39 extern "C" {
40 #endif
41
42 MAKE_REF(cpv); // makes a variable named _cpv that contains the function pointer for cpv()
43 MAKE_REF(cpveql);
44 MAKE_REF(cpvadd);
45 MAKE_REF(cpvneg);
46 MAKE_REF(cpvsub);
47 MAKE_REF(cpvmult);
48 MAKE_REF(cpvdot);
49 MAKE_REF(cpvcross);
50 MAKE_REF(cpvperp);
51 MAKE_REF(cpvrperp);
52 MAKE_REF(cpvproject);
53 MAKE_REF(cpvforangle);
54 MAKE_REF(cpvtoangle);
55 MAKE_REF(cpvrotate);
56 MAKE_REF(cpvunrotate);
57 MAKE_REF(cpvlengthsq);
58 MAKE_REF(cpvlength);
59 MAKE_REF(cpvlerp);
60 MAKE_REF(cpvnormalize);
61 MAKE_REF(cpvclamp);
62 MAKE_REF(cpvlerpconst);
63 MAKE_REF(cpvdist);
64 MAKE_REF(cpvdistsq);
65 MAKE_REF(cpvnear);
66
67 MAKE_REF(cpfmax);
68 MAKE_REF(cpfmin);
69 MAKE_REF(cpfabs);
70 MAKE_REF(cpfclamp);
71 MAKE_REF(cpflerp);
72 MAKE_REF(cpflerpconst);
73
74 MAKE_REF(cpBBNew);
75 MAKE_REF(cpBBNewForExtents);
76 MAKE_REF(cpBBNewForCircle);
77 MAKE_REF(cpBBIntersects);
78 MAKE_REF(cpBBContainsBB);
79 MAKE_REF(cpBBContainsVect);
80 MAKE_REF(cpBBMerge);
81 MAKE_REF(cpBBExpand);
82 MAKE_REF(cpBBCenter);
83 MAKE_REF(cpBBArea);
84 MAKE_REF(cpBBMergedArea);
85 MAKE_REF(cpBBSegmentQuery);
86 MAKE_REF(cpBBIntersectsSegment);
87 MAKE_REF(cpBBClampVect);
88
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);
100
101 #ifdef __cplusplus
102 }
103 #endif
104
105 #endif