XnPlatformWin32.h
Go to the documentation of this file.
00001 /*****************************************************************************
00002 *                                                                            *
00003 *  OpenNI 1.0 Alpha                                                          *
00004 *  Copyright (C) 2010 PrimeSense Ltd.                                        *
00005 *                                                                            *
00006 *  This file is part of OpenNI.                                              *
00007 *                                                                            *
00008 *  OpenNI is free software: you can redistribute it and/or modify            *
00009 *  it under the terms of the GNU Lesser General Public License as published  *
00010 *  by the Free Software Foundation, either version 3 of the License, or      *
00011 *  (at your option) any later version.                                       *
00012 *                                                                            *
00013 *  OpenNI is distributed in the hope that it will be useful,                 *
00014 *  but WITHOUT ANY WARRANTY; without even the implied warranty of            *
00015 *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the              *
00016 *  GNU Lesser General Public License for more details.                       *
00017 *                                                                            *
00018 *  You should have received a copy of the GNU Lesser General Public License  *
00019 *  along with OpenNI. If not, see <http://www.gnu.org/licenses/>.            *
00020 *                                                                            *
00021 *****************************************************************************/
00022 
00023 
00024 
00025 
00026 #ifndef _XN_PLATFORM_WIN32_H_
00027 #define _XN_PLATFORM_WIN32_H_
00028 
00029 //---------------------------------------------------------------------------
00030 // Prerequisites
00031 //---------------------------------------------------------------------------
00032 #ifndef WINVER                                          // Allow use of features specific to Windows XP or later
00033 #define WINVER 0x0501
00034 #endif
00035 #ifndef _WIN32_WINNT                            // Allow use of features specific to Windows XP or later
00036 #define _WIN32_WINNT 0x0501
00037 #endif                                          
00038 #ifndef _WIN32_WINDOWS                          // Allow use of features specific to Windows 98 or later
00039 #define _WIN32_WINDOWS 0x0410
00040 #endif
00041 #ifndef _WIN32_IE                                       // Allow use of features specific to IE 6.0 or later
00042 #define _WIN32_IE 0x0600
00043 #endif
00044 #define WIN32_LEAN_AND_MEAN                     // Exclude rarely-used stuff from Windows headers
00045 
00046 #define _CRT_SECURE_NO_DEPRECATE 1      // Undeprecate CRT functions
00047 
00048 //---------------------------------------------------------------------------
00049 // Includes
00050 //---------------------------------------------------------------------------
00051 #include <windows.h>
00052 #include <stdlib.h>
00053 #include <stdio.h>
00054 #include <malloc.h>
00055 #include <io.h>
00056 #include <time.h>
00057 #include <assert.h>
00058 #include <float.h>
00059 #include <crtdbg.h>
00060 
00061 //---------------------------------------------------------------------------
00062 // Platform Basic Definition
00063 //---------------------------------------------------------------------------
00064 #define XN_PLATFORM XN_PLATFORM_WIN32
00065 #define XN_PLATFORM_STRING "Win32"
00066 
00067 //---------------------------------------------------------------------------
00068 // Platform Capabilities
00069 //---------------------------------------------------------------------------
00070 #define XN_PLATFORM_ENDIAN_TYPE XN_PLATFORM_IS_LITTLE_ENDIAN
00071 
00072 #if _MSC_VER < 1400 // Before VS2005 there was no support for the vaargs macro...
00073         #define XN_PLATFORM_VAARGS_TYPE XN_PLATFORM_USE_NO_VAARGS
00074 #else
00075         #define XN_PLATFORM_VAARGS_TYPE XN_PLATFORM_USE_WIN32_VAARGS_STYLE
00076 #endif
00077 
00078 #define XN_PLATFORM_SUPPORTS_DYNAMIC_LIBS 1
00079 
00080 //---------------------------------------------------------------------------
00081 // Basic Types
00082 //---------------------------------------------------------------------------
00084 typedef BOOL                            XnBool;
00085 
00087 typedef char                            XnChar;
00089 typedef unsigned char           XnUChar;
00090 
00092 typedef wchar_t                         XnWChar;
00093 
00095 typedef char                            XnInt8;
00097 typedef unsigned char           XnUInt8;
00098 
00100 typedef short                           XnInt16;
00102 typedef unsigned short          XnUInt16;
00103 
00105 typedef int                                     XnInt32;
00107 typedef unsigned int            XnUInt32;
00108 
00110 typedef __int64                         XnInt64;
00112 typedef unsigned __int64        XnUInt64;
00113 
00115 typedef int                                     XnInt;
00117 typedef unsigned int            XnUInt;
00118 
00120 typedef float                           XnFloat;
00122 typedef double                          XnDouble;
00123 
00125 typedef FARPROC                         XnFarProc;
00126 
00128 typedef size_t                          XnSizeT;
00129 
00131 #define XN_MAX_UINT8 255
00132 
00133 #define XN_MAX_UINT16 65535
00134 
00135 #define XN_MAX_UINT32 4294967295
00136 
00137 #define XN_MAX_UINT64 18446744073709551615
00138 
00140 #define XN_MIN_INT8 -127
00141 
00142 #define XN_MIN_INT16 -32767
00143 
00144 #define XN_MIN_INT32 -2147483647
00145 
00146 #define XN_MIN_INT64 -9223372036854775807
00147 
00149 #define XN_MAX_INT8 127
00150 
00151 #define XN_MAX_INT16 32767
00152 
00153 #define XN_MAX_INT32 2147483647
00154 
00155 #define XN_MAX_INT64 9223372036854775807
00156 
00158 #define XN_MIN_DOUBLE DBL_MIN 
00159 
00160 #define XN_MAX_DOUBLE DBL_MAX
00161 
00162 //---------------------------------------------------------------------------
00163 // Memory
00164 //---------------------------------------------------------------------------
00166 #define XN_DEFAULT_MEM_ALIGN 16
00167 
00169 #define XN_THREAD_STATIC __declspec(thread)
00170 
00171 //---------------------------------------------------------------------------
00172 // Files
00173 //---------------------------------------------------------------------------
00175 #define XN_FILE_MAX_PATH MAX_PATH
00176 
00177 //---------------------------------------------------------------------------
00178 // Call backs
00179 //---------------------------------------------------------------------------
00181 #define XN_STDCALL __stdcall
00182 
00184 #define XN_CALLBACK_TYPE XN_STDCALL
00185 
00187 #define XN_C_DECL __cdecl
00188 
00189 //---------------------------------------------------------------------------
00190 // Macros
00191 //---------------------------------------------------------------------------
00193 #define XN_TIMESTAMP __DATE__ " " __TIME__
00194 
00196 #define XN_STRINGIFY(n) XN_STRINGIFY_HELPER(n)
00197 #define XN_STRINGIFY_HELPER(n) #n
00198 
00200 #define XN_ASSERT(x)    _ASSERTE(x)
00201 
00202 //---------------------------------------------------------------------------
00203 // API Export/Import Macros
00204 //---------------------------------------------------------------------------
00206 #define XN_API_EXPORT __declspec(dllexport)
00207 
00209 #define XN_API_IMPORT __declspec(dllimport)
00210 
00212 #if _MSC_VER < 1400 // Before VS2005 there was no support for declspec deprecated...
00213         #define XN_API_DEPRECATED(msg)
00214 #else
00215         #define XN_API_DEPRECATED(msg) __declspec(deprecated(msg))
00216 #endif
00217 
00218 #ifdef __INTEL_COMPILER
00219         #define XN_DEPRECATED_WARNING_IDS       1786
00220 #else
00221         #define XN_DEPRECATED_WARNING_IDS       4995 4996
00222 #endif
00223 
00225 #define XN_API_EXPORT_INIT()                                                                                                                    \
00226         BOOL APIENTRY DllMain (HMODULE /*hModule*/, DWORD nReasonForCall, LPVOID /*lpReserved*/)        \
00227         {                                                                                                                                                                       \
00228                 switch (nReasonForCall)                                                                                                                 \
00229                 {                                                                                                                                                               \
00230                 case DLL_PROCESS_ATTACH:                                                                                                                \
00231                 case DLL_THREAD_ATTACH:                                                                                                                 \
00232                 case DLL_THREAD_DETACH:                                                                                                                 \
00233                 case DLL_PROCESS_DETACH:                                                                                                                \
00234                         break;                                                                                                                                          \
00235                 }                                                                                                                                                               \
00236                 return TRUE;                                                                                                                                    \
00237         }
00238 
00239 #endif //_XN_PLATFORM_WIN32_H_


nao_openni
Author(s): Bener SUAY
autogenerated on Mon Jan 6 2014 11:27:51