42 #if (defined(__APPLE__) && (defined(__GNUC__) ||\
43 defined(__xlC__) || defined(__xlc__))) || defined(__MACOS__)
44 # if (defined(__ENVIRONMENT_IPHONE_OS_VERSION_MIN_REQUIRED__) || defined(__IPHONE_OS_VERSION_MIN_REQUIRED))
45 # define OVR_OS_IPHONE
47 # define OVR_OS_DARWIN
50 #elif (defined(WIN64) || defined(_WIN64) || defined(__WIN64__))
52 #elif (defined(WIN32) || defined(_WIN32) || defined(__WIN32__) || defined(__NT__))
54 #elif defined(__linux__) || defined(__linux)
61 # define OVR_OS_ANDROID
78 #if defined(__x86_64__) || defined(WIN64) || defined(_WIN64) || defined(__WIN64__)
79 # define OVR_CPU_X86_64
80 # define OVR_64BIT_POINTERS
81 #elif defined(__i386__) || defined(OVR_OS_WIN32)
83 #elif defined(__powerpc64__)
84 # define OVR_CPU_PPC64
85 #elif defined(__ppc__)
87 #elif defined(__mips__) || defined(__MIPSEL__)
89 #elif defined(__arm__)
92 # define OVR_CPU_OTHER
104 #if defined(__SSE__) || defined(OVR_OS_WIN32)
108 #if defined( __ALTIVEC__ )
109 # define OVR_CPU_ALTIVEC
110 #endif // __ALTIVEC__
112 #if defined(__ARM_NEON__)
113 # define OVR_CPU_ARM_NEON
114 #endif // __ARM_NEON__
127 #if defined(__INTEL_COMPILER)
133 # define OVR_CC_INTEL __INTEL_COMPILER
135 #elif defined(_MSC_VER)
145 # define OVR_CC_MSVC _MSC_VER
147 #elif defined(__GNUC__)
150 #elif defined(__CC_ARM)
154 # error "Oculus does not support this Compiler"
162 #if defined(OVR_CC_MSVC)
163 # pragma warning(disable : 4127) // Inconsistent dll linkage
164 # pragma warning(disable : 4530) // Exception handling
165 # if (OVR_CC_MSVC<1300)
166 # pragma warning(disable : 4514) // Unreferenced inline function has been removed
167 # pragma warning(disable : 4710) // Function not inlined
168 # pragma warning(disable : 4714) // _force_inline not inlined
169 # pragma warning(disable : 4786) // Debug variable name longer than 255 chars
170 # endif // (OVR_CC_MSVC<1300)
171 #endif // (OVR_CC_MSVC)
193 #if defined(OVR_CC_MSVC) && defined(OVR_BUILD_DEBUG)
194 # define _CRTDBG_MAP_ALLOC
201 # ifndef OVR_DEFINE_NEW
202 # define OVR_DEFINE_NEW new(__FILE__, __LINE__)
203 # define new OVR_DEFINE_NEW
222 #if defined(OVR_OS_WIN32)
227 typedef unsigned short UInt16;
234 #elif defined(OVR_OS_MAC) || defined(OVR_OS_IPHONE) || defined(OVR_CC_GNU)
247 #include <sys/types.h>
301 #define OVR_LITTLE_ENDIAN 1
302 #define OVR_BIG_ENDIAN 2
306 #if defined(OVR_CC_MSVC)
307 # define OVR_FORCE_INLINE __forceinline
308 #elif defined(OVR_CC_GNU)
309 # define OVR_FORCE_INLINE __attribute__((always_inline)) inline
311 # define OVR_FORCE_INLINE inline
312 #endif // OVR_CC_MSVC
315 #if defined(OVR_OS_WIN32)
320 #define OVR_BYTE_ORDER OVR_LITTLE_ENDIAN
323 #ifdef __cplusplus_cli
324 # define OVR_FASTCALL __stdcall
326 # define OVR_FASTCALL __fastcall
329 #define OVR_STDCALL __stdcall
330 #define OVR_CDECL __cdecl
334 #if defined(OVR_CC_MSVC)
335 # define OVR_ASM _asm
338 #endif // (OVR_CC_MSVC)
341 # define OVR_STR(str) L##str
343 # define OVR_STR(str) str
350 #if (defined(BYTE_ORDER) && (BYTE_ORDER == BIG_ENDIAN))|| \
351 (defined(_BYTE_ORDER) && (_BYTE_ORDER == _BIG_ENDIAN))
352 # define OVR_BYTE_ORDER OVR_BIG_ENDIAN
353 #elif (defined(__ARMEB__) || defined(OVR_CPU_PPC) || defined(OVR_CPU_PPC64))
354 # define OVR_BYTE_ORDER OVR_BIG_ENDIAN
356 # define OVR_BYTE_ORDER OVR_LITTLE_ENDIAN
360 #define OVR_ASM __asm__
361 #define OVR_ASM_PROC(procname) OVR_ASM
362 #define OVR_ASM_END OVR_ASM
369 #endif // defined(OVR_OS_WIN32)
377 #ifndef OVR_BUILD_DEBUG
379 # define OVR_DEBUG_CODE(c) c
380 # define OVR_DEBUG_BREAK ((void)0)
381 # define OVR_ASSERT(p) ((void)0)
386 #if defined(OVR_OS_WIN32)
388 # if defined(__cplusplus_cli)
389 # define OVR_DEBUG_BREAK do { __debugbreak(); } while(0)
390 # elif defined(OVR_CC_GNU)
391 # define OVR_DEBUG_BREAK do { OVR_ASM("int $3\n\t"); } while(0)
393 # define OVR_DEBUG_BREAK do { OVR_ASM int 3 } while (0)
396 # define OVR_DEBUG_BREAK do { __debugbreak(); } while(0)
399 #elif defined(OVR_CPU_X86) || defined(OVR_CPU_X86_64)
400 # define OVR_DEBUG_BREAK do { OVR_ASM("int $3\n\t"); } while(0)
402 # define OVR_DEBUG_BREAK do { *((int *) 0) = 1; } while(0)
405 #define OVR_DEBUG_CODE(c)
408 #define OVR_ASSERT(p) do { if (!(p)) { OVR_DEBUG_BREAK; } } while(0)
410 #endif // OVR_BUILD_DEBUG
414 #define OVR_COMPILER_ASSERT(x) { int zero = 0; switch(zero) {case 0: case x:;} }
422 #if defined(OVR_CC_GNU)
423 # define OVR_UNUSED(a) do {__typeof__ (&a) __attribute__ ((unused)) __tmp = &a; } while(0)
425 # define OVR_UNUSED(a) (a)
428 #define OVR_UNUSED1(a1) OVR_UNUSED(a1)
429 #define OVR_UNUSED2(a1,a2) OVR_UNUSED(a1); OVR_UNUSED(a2)
430 #define OVR_UNUSED3(a1,a2,a3) OVR_UNUSED2(a1,a2); OVR_UNUSED(a3)
431 #define OVR_UNUSED4(a1,a2,a3,a4) OVR_UNUSED3(a1,a2,a3); OVR_UNUSED(a4)
432 #define OVR_UNUSED5(a1,a2,a3,a4,a5) OVR_UNUSED4(a1,a2,a3,a4); OVR_UNUSED(a5)
433 #define OVR_UNUSED6(a1,a2,a3,a4,a5,a6) OVR_UNUSED4(a1,a2,a3,a4); OVR_UNUSED2(a5,a6)
434 #define OVR_UNUSED7(a1,a2,a3,a4,a5,a6,a7) OVR_UNUSED4(a1,a2,a3,a4); OVR_UNUSED3(a5,a6,a7)
435 #define OVR_UNUSED8(a1,a2,a3,a4,a5,a6,a7,a8) OVR_UNUSED4(a1,a2,a3,a4); OVR_UNUSED4(a5,a6,a7,a8)
436 #define OVR_UNUSED9(a1,a2,a3,a4,a5,a6,a7,a8,a9) OVR_UNUSED4(a1,a2,a3,a4); OVR_UNUSED5(a5,a6,a7,a8,a9)
443 #ifdef OVR_BUILD_DEBUG
444 # define OVR_BUILD_STRING "Debug"
446 # define OVR_BUILD_STRING "Release"
455 #ifdef OVR_BUILD_DEBUG
456 #define OVR_DEBUG_STATEMENT(s) s
457 #define OVR_DEBUG_SELECT(d, nd) d
459 #define OVR_DEBUG_STATEMENT(s)
460 #define OVR_DEBUG_SELECT(d, nd) nd
464 #define OVR_ENABLE_THREADS
474 #endif // OVR_Types_h
#define __attribute__(xyz)
__END_DECLS typedef int8_t SByte