summaryrefslogtreecommitdiff
path: root/Runtime/mecanim/defs.h
diff options
context:
space:
mode:
authorchai <chaifix@163.com>2019-08-14 22:50:43 +0800
committerchai <chaifix@163.com>2019-08-14 22:50:43 +0800
commit15740faf9fe9fe4be08965098bbf2947e096aeeb (patch)
treea730ec236656cc8cab5b13f088adfaed6bb218fb /Runtime/mecanim/defs.h
+Unity Runtime codeHEADmaster
Diffstat (limited to 'Runtime/mecanim/defs.h')
-rw-r--r--Runtime/mecanim/defs.h116
1 files changed, 116 insertions, 0 deletions
diff --git a/Runtime/mecanim/defs.h b/Runtime/mecanim/defs.h
new file mode 100644
index 0000000..734dc10
--- /dev/null
+++ b/Runtime/mecanim/defs.h
@@ -0,0 +1,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
+