7878 #define AMF_STD_CALL __stdcall
7979 #define AMF_CDECL_CALL __cdecl
8080 #define AMF_FAST_CALL __fastcall
81+ #if defined(__GNUC__) || defined(__clang__)
82+ #define AMF_INLINE inline
83+ #define AMF_FORCEINLINE inline
84+ #else
8185 #define AMF_INLINE __inline
8286 #define AMF_FORCEINLINE __forceinline
87+ #endif
8388 #define AMF_NO_VTABLE __declspec (novtable)
8489
8590 #define AMFPRId64 " I64d"
96101 #define AMF_STD_CALL
97102 #define AMF_CDECL_CALL
98103 #define AMF_FAST_CALL
104+ #if defined(__GNUC__) || defined(__clang__)
105+ #define AMF_INLINE inline
106+ #define AMF_FORCEINLINE inline
107+ #else
99108 #define AMF_INLINE __inline__
100109 #define AMF_FORCEINLINE __inline__
110+ #endif
101111 #define AMF_NO_VTABLE
102112
103113 #if !defined(AMFPRId64)
@@ -145,7 +155,7 @@ typedef void amf_void;
145155#if defined(__cplusplus)
146156typedef bool amf_bool;
147157#else
148- typedef amf_uint16 amf_bool;
158+ typedef amf_uint8 amf_bool;
149159#define true 1
150160#define false 0
151161#endif
@@ -187,7 +197,7 @@ typedef struct AMFRect
187197#endif
188198} AMFRect;
189199
190- AMF_INLINE struct AMFRect AMFConstructRect (amf_int32 left, amf_int32 top, amf_int32 right, amf_int32 bottom)
200+ static AMF_INLINE struct AMFRect AMFConstructRect (amf_int32 left, amf_int32 top, amf_int32 right, amf_int32 bottom)
191201{
192202 struct AMFRect object = {left, top, right, bottom};
193203 return object;
@@ -206,7 +216,7 @@ typedef struct AMFSize
206216#endif
207217} AMFSize;
208218
209- AMF_INLINE struct AMFSize AMFConstructSize (amf_int32 width, amf_int32 height)
219+ static AMF_INLINE struct AMFSize AMFConstructSize (amf_int32 width, amf_int32 height)
210220{
211221 struct AMFSize object = {width, height};
212222 return object;
@@ -225,7 +235,7 @@ typedef struct AMFPoint
225235#endif
226236} AMFPoint;
227237
228- AMF_INLINE struct AMFPoint AMFConstructPoint (amf_int32 x, amf_int32 y)
238+ static AMF_INLINE struct AMFPoint AMFConstructPoint (amf_int32 x, amf_int32 y)
229239{
230240 struct AMFPoint object = {x, y};
231241 return object;
@@ -244,7 +254,7 @@ typedef struct AMFRate
244254#endif
245255} AMFRate;
246256
247- AMF_INLINE struct AMFRate AMFConstructRate (amf_uint32 num, amf_uint32 den)
257+ static AMF_INLINE struct AMFRate AMFConstructRate (amf_uint32 num, amf_uint32 den)
248258{
249259 struct AMFRate object = {num, den};
250260 return object;
@@ -263,7 +273,7 @@ typedef struct AMFRatio
263273#endif
264274} AMFRatio;
265275
266- AMF_INLINE struct AMFRatio AMFConstructRatio (amf_uint32 num, amf_uint32 den)
276+ static AMF_INLINE struct AMFRatio AMFConstructRatio (amf_uint32 num, amf_uint32 den)
267277{
268278 struct AMFRatio object = {num, den};
269279 return object;
@@ -306,7 +316,7 @@ typedef struct AMFColor
306316#pragma pack(pop)
307317
308318
309- AMF_INLINE struct AMFColor AMFConstructColor (amf_uint8 r, amf_uint8 g, amf_uint8 b, amf_uint8 a)
319+ static AMF_INLINE struct AMFColor AMFConstructColor (amf_uint8 r, amf_uint8 g, amf_uint8 b, amf_uint8 a)
310320{
311321 struct AMFColor object;
312322 object.r = r;
@@ -324,11 +334,11 @@ AMF_INLINE struct AMFColor AMFConstructColor(amf_uint8 r, amf_uint8 g, amf_uint8
324334 {
325335 #endif
326336 // allocator
327- AMF_INLINE void * AMF_CDECL_CALL amf_variant_alloc (amf_size count)
337+ static AMF_INLINE void * AMF_CDECL_CALL amf_variant_alloc (amf_size count)
328338 {
329339 return CoTaskMemAlloc (count);
330340 }
331- AMF_INLINE void AMF_CDECL_CALL amf_variant_free (void * ptr)
341+ static AMF_INLINE void AMF_CDECL_CALL amf_variant_free (void * ptr)
332342 {
333343 CoTaskMemFree (ptr);
334344 }
@@ -343,11 +353,11 @@ AMF_INLINE struct AMFColor AMFConstructColor(amf_uint8 r, amf_uint8 g, amf_uint8
343353 {
344354 #endif
345355 // allocator
346- AMF_INLINE void * AMF_CDECL_CALL amf_variant_alloc (amf_size count)
356+ static AMF_INLINE void * AMF_CDECL_CALL amf_variant_alloc (amf_size count)
347357 {
348358 return malloc (count);
349359 }
350- AMF_INLINE void AMF_CDECL_CALL amf_variant_free (void * ptr)
360+ static AMF_INLINE void AMF_CDECL_CALL amf_variant_free (void * ptr)
351361 {
352362 free (ptr);
353363 }
0 commit comments