OpenNI 1.5.7
XnPlatform.h
Go to the documentation of this file.
1 /*****************************************************************************
2 * *
3 * OpenNI 1.x Alpha *
4 * Copyright (C) 2012 PrimeSense Ltd. *
5 * *
6 * This file is part of OpenNI. *
7 * *
8 * Licensed under the Apache License, Version 2.0 (the "License"); *
9 * you may not use this file except in compliance with the License. *
10 * You may obtain a copy of the License at *
11 * *
12 * http://www.apache.org/licenses/LICENSE-2.0 *
13 * *
14 * Unless required by applicable law or agreed to in writing, software *
15 * distributed under the License is distributed on an "AS IS" BASIS, *
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. *
17 * See the License for the specific language governing permissions and *
18 * limitations under the License. *
19 * *
20 *****************************************************************************/
21 #ifndef __XN_PLATFORM_H__
22 #define __XN_PLATFORM_H__
23 
24 //---------------------------------------------------------------------------
25 // Platform Defines
26 //---------------------------------------------------------------------------
27 #define XN_PLATFORM_WIN32 1
28 #define XN_PLATFORM_XBOX360 2
29 #define XN_PLATFORM_PS3 3
30 #define XN_PLATFORM_WII 4
31 #define XN_PLATFORM_LINUX_X86 5
32 #define XN_PLATFORM_FILES_ONLY 6
33 #define XN_PLATFORM_ARC 6
34 #define XN_PLATFORM_LINUX_ARM 7
35 #define XN_PLATFORM_MACOSX 8
36 #define XN_PLATFORM_ANDROID_ARM 9
37 
38 #define XN_PLATFORM_IS_LITTLE_ENDIAN 1
39 #define XN_PLATFORM_IS_BIG_ENDIAN 2
40 
41 #define XN_PLATFORM_USE_NO_VAARGS 1
42 #define XN_PLATFORM_USE_WIN32_VAARGS_STYLE 2
43 #define XN_PLATFORM_USE_GCC_VAARGS_STYLE 3
44 #define XN_PLATFORM_USE_ARC_VAARGS_STYLE 4
45 
46 //---------------------------------------------------------------------------
47 // Platform Identifier
48 //---------------------------------------------------------------------------
49 
50 #if defined(_WIN32) // Microsoft Visual Studio
51  #ifndef RC_INVOKED
52  #if _MSC_VER < 1300 // Before MSVC7 (2003)
53  #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions below 2003 (7.0) are not supported!
54  #endif
55 
56  #if _MSC_VER > 1600 // After MSVC8 (2010)
57  #error Xiron Platform Abstraction Layer - Win32 - Microsoft Visual Studio versions above 2010 (10.0) are not supported!
58  #endif
59  #endif
60 
61  #include "Win32/XnPlatformWin32.h"
62 #elif defined(ANDROID) && defined(__arm__)
63  #include "Android-Arm/XnPlatformAndroid-Arm.h"
64 #elif (linux && (i386 || __x86_64__))
65  #include "Linux-x86/XnPlatformLinux-x86.h"
66 #elif (linux && __arm__)
67  #include "Linux-Arm/XnPlatformLinux-Arm.h"
68 #elif (linux && __mips__)
69  #include "Linux-Arm/XnPlatformLinux-mips.h"
70 #elif _ARC
71  #include "ARC/XnPlatformARC.h"
72 #elif (__APPLE__)
73  #include "MacOSX/XnPlatformMacOSX.h"
74 #else
75  #if defined __INTEL_COMPILER
76  #include "Linux/XnPlatformLinux.h"
77  #else
78  #error OpenNI Platform Abstraction Layer - Unsupported Platform!
79  #endif
80 #endif
81 
82 
83 //---------------------------------------------------------------------------
84 // Basic Common Macros
85 //---------------------------------------------------------------------------
86 #ifndef TRUE
87  #define TRUE 1
88 #endif
89 
90 #ifndef FALSE
91  #define FALSE 0
92 #endif
93 
94 #define XN_MIN(a,b) (((a) < (b)) ? (a) : (b))
95 
96 #define XN_MAX(a,b) (((a) > (b)) ? (a) : (b))
97 
98 typedef void (*XnFuncPtr)();
99 
100 #define XN_COMPILER_ASSERT(x) typedef int compileAssert[x ? 1 : -1]
101 
102 struct XnRegistrationHandleImpl;
103 typedef struct XnRegistrationHandleImpl* XnRegistrationHandle;
104 
105 //---------------------------------------------------------------------------
106 // API Export/Import Macros
107 //---------------------------------------------------------------------------
108 
109 #ifdef __cplusplus
110  #define XN_C_API_EXPORT extern "C" XN_API_EXPORT
111  #define XN_C_API_IMPORT extern "C" XN_API_IMPORT
112  #define XN_CPP_API_EXPORT XN_API_EXPORT
113  #define XN_CPP_API_IMPORT XN_API_IMPORT
114 #else
115  #define XN_C_API_EXPORT XN_API_EXPORT
116  #define XN_C_API_IMPORT XN_API_IMPORT
117 #endif
118 
119 #ifdef XN_EXPORTS
120  #define XN_C_API XN_C_API_EXPORT
121  #define XN_CPP_API XN_CPP_API_EXPORT
122 #else
123  #define XN_C_API XN_C_API_IMPORT
124  #define XN_CPP_API XN_CPP_API_IMPORT
125 #endif
126 
127 #endif //__XN_PLATFORM_H__
128 
void(* XnFuncPtr)()
Definition: XnPlatform.h:98
struct XnRegistrationHandleImpl * XnRegistrationHandle
Definition: XnPlatform.h:103