summaryrefslogtreecommitdiff
path: root/Runtime/mecanim/defs.h
blob: 734dc10a90364b33c726591553cd88f9b23d428a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
#pragma once

/***
* defs.h - definitions/declarations for some commonly standard declaration
*
*
* Purpose:
*       This file defines the following ma keywords:
*	RESTRICT			
*	MECANIM_FORCE_INLINE	
*   STATIC_INLINE
*	ATTRIBUTE_ALIGN(a)	
*	EXPLICIT_TYPENAME
*	EXPLICIT_TEMPLATE
*	DLL_IMPORT			
*	DLL_EXPORT
*   DECLARE_C
*
****/

#if defined(__INTEL_COMPILER) || defined(__ICL)
	#include <cstddef>
	#define RESTRICT				__restrict
	#define MECANIM_FORCE_INLINE	__forceinline
	#define ATTRIBUTE_ALIGN(a)		__declspec(align(a))
	#define EXPLICIT_TEMPLATE		template
	#define DLL_IMPORT				__declspec(dllimport)
	#define DLL_EXPORT				__declspec(dllexport)
	#define ALIGN4F					16
	#define DECLARE_C				__cdecl

#elif defined(_MSC_VER) 
	#include <cstddef>
	#define RESTRICT				__restrict
	#define MECANIM_FORCE_INLINE	__forceinline
	#define ATTRIBUTE_ALIGN(a)		__declspec(align(a))
	#define EXPLICIT_TEMPLATE		template
	#define DLL_IMPORT				__declspec(dllimport)
	#define DLL_EXPORT				__declspec(dllexport)
	#define ALIGN4F					16
	#define DECLARE_C				__cdecl

	#pragma warning( disable : 4996)

#elif defined(__GNUC__)
	#include <cstddef>
	#if ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 1)) || (__GNUC__ >= 4)
        #ifdef _DEBUG
            #ifndef MECANIM_FORCE_INLINE
                #define MECANIM_FORCE_INLINE		inline 
            #endif  
		    #define STATIC_INLINE		inline 
        #else
            #ifndef MECANIM_FORCE_INLINE
                #define MECANIM_FORCE_INLINE		inline __attribute__((always_inline))
            #endif
            #define STATIC_INLINE		inline __attribute__((always_inline))
        #endif
	#else
		#define STATIC_INLINE			extern inline
	#endif

	#define ATTRIBUTE_ALIGN(a)			__attribute__ ((aligned(a)))
	#define ALIGN4F						16

	#if ((__GNUC__ >= 3) && (__GNUC_MINOR__ >= 4)) || (__GNUC__ >= 4)
		#define EXPLICIT_TEMPLATE	template
	#endif	
#endif

#if defined(__GNUC__) && ((__GNUC__ <= 4) && (__GNUC_MINOR__ <= 2))
 #define TEMPLATE_SPEC(L, R) template<L,R>
#else
 #define TEMPLATE_SPEC(L, R) template<>
#endif

#ifndef RESTRICT
	#define RESTRICT
#endif

#ifndef MECANIM_FORCE_INLINE	
	#define MECANIM_FORCE_INLINE		inline
#endif

#ifndef STATIC_INLINE
	#define	STATIC_INLINE		static inline
#endif

#ifndef ATTRIBUTE_ALIGN
	#define ATTRIBUTE_ALIGN(a)
#endif

#ifndef EXPLICIT_TYPENAME
	#define EXPLICIT_TYPENAME	typename
#endif

#ifndef EXPLICIT_TEMPLATE
	#define EXPLICIT_TEMPLATE
#endif

#ifndef DLL_IMPORT
	#define DLL_IMPORT
#endif

#ifndef DLL_EXPORT
	#define DLL_EXPORT
#endif

#ifndef ALIGN4F
	#define ALIGN4F						16
#endif

#ifndef DECLARE_C
	#define DECLARE_C
#endif