Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials

# irrTypes.h

Go to the documentation of this file.

    00001 // Copyright (C) 2002-2010 Nikolaus Gebhardt
    00002 // This file is part of the "Irrlicht Engine".
    00003 // For conditions of distribution and use, see copyright notice in irrlicht.h
    00004
    00005 #ifndef __IRR_TYPES_H_INCLUDED__
    00006 #define __IRR_TYPES_H_INCLUDED__
    00007
    00008 #include "IrrCompileConfig.h"
    00009
    00010 namespace irr
    00011 {
    00012
    00014
    00015 #ifdef _MSC_VER
    00016 typedef unsigned __int8         u8;
    00017 #else
    00018 typedef unsigned char           u8;
    00019 #endif
    00020
    00022
    00023 #ifdef _MSC_VER
    00024 typedef __int8                  s8;
    00025 #else
    00026 typedef signed char             s8;
    00027 #endif
    00028
    00030
    00031 typedef char                    c8;
    00032
    00033
    00034
    00036
    00037 #ifdef _MSC_VER
    00038 typedef unsigned __int16        u16;
    00039 #else
    00040 typedef unsigned short          u16;
    00041 #endif
    00042
    00044
    00045 #ifdef _MSC_VER
    00046 typedef __int16                 s16;
    00047 #else
    00048 typedef signed short            s16;
    00049 #endif
    00050
    00051
    00052
    00054
    00055 #ifdef _MSC_VER
    00056 typedef unsigned __int32        u32;
    00057 #else
    00058 typedef unsigned int            u32;
    00059 #endif
    00060
    00062
    00063 #ifdef _MSC_VER
    00064 typedef __int32                 s32;
    00065 #else
    00066 typedef signed int              s32;
    00067 #endif
    00068
    00069
    00070
    00071 // 64 bit signed variable.
    00072 // This is a typedef for __int64, it ensures portability of the engine.
    00073 // This type is currently not used by the engine and not supported by compilers
    00074 // other than Microsoft Compilers, so it is outcommented.
    00075 //typedef __int64                               s64;
    00076
    00077
    00078
    00080
    00081 typedef float                           f32;
    00082
    00084
    00085 typedef double                          f64;
    00086
    00087
    00088 } // end namespace irr
    00089
    00090
    00091 #include <wchar.h>
    00092 #ifdef _IRR_WINDOWS_API_
    00097 #if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE)
    00098 #define swprintf swprintf_s
    00099 #define snprintf sprintf_s
    00100 #else
    00101 #define swprintf _snwprintf
    00102 #define snprintf _snprintf
    00103 #endif
    00104
    00105 // define the wchar_t type if not already built in.
    00106 #ifdef _MSC_VER
    00107 #ifndef _WCHAR_T_DEFINED
    00109
    00116 typedef unsigned short wchar_t;
    00117 #define _WCHAR_T_DEFINED
    00118 #endif // wchar is not defined
    00119 #endif // microsoft compiler
    00120 #endif // _IRR_WINDOWS_API_
    00121
    00122 namespace irr
    00123 {
    00124
    00126
    00131 #if defined(_IRR_WCHAR_FILESYSTEM)
    00132         typedef wchar_t fschar_t;
    00133 #else
    00134         typedef char fschar_t;
    00135 #endif
    00136
    00137 } // end namespace irr
    00138
    00140 #if defined(_DEBUG)
    00141 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
    00142   #if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
    00143   #include <crtdbg.h>
    00144   #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
    00145   #else
    00146   #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
    00147   #endif
    00148 #else
    00149 #include "assert.h"
    00150 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
    00151 #endif
    00152 #else
    00153 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
    00154 #endif
    00155
    00157
    00163 #if defined(IGNORE_DEPRECATED_WARNING)
    00164 #define _IRR_DEPRECATED_
    00165 #elif _MSC_VER >= 1310 //vs 2003 or higher
    00166 #define _IRR_DEPRECATED_ __declspec(deprecated)
    00167 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) // all versions above 3.0 should support this feature
    00168 #define _IRR_DEPRECATED_  __attribute__ ((deprecated))
    00169 #else
    00170 #define _IRR_DEPRECATED_
    00171 #endif
    00172
    00174
    00179 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
    00180 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
    00181 #else
    00182 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
    00183 #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
    00184
    00185
    00186 // memory debugging
    00187 #if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \
    00188         (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE)
    00189
    00190         #define CRTDBG_MAP_ALLOC
    00191         #define _CRTDBG_MAP_ALLOC
    00192         #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
    00193         #include <stdlib.h>
    00194         #include <crtdbg.h>
    00195         #define new DEBUG_CLIENTBLOCK
    00196 #endif
    00197
    00198 // disable truncated debug information warning in visual studio 6 by default
    00199 #if defined(_MSC_VER) && (_MSC_VER < 1300 )
    00200 #pragma warning( disable: 4786)
    00201 #endif // _MSC
    00202
    00203
    00205
    00206 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400)
    00207         //#pragma warning( disable: 4996)
    00208         //#define _CRT_SECURE_NO_DEPRECATE 1
    00209         //#define _CRT_NONSTDC_NO_DEPRECATE 1
    00210 #endif
    00211
    00212
    00214
    00216 #define MAKE_IRR_ID(c0, c1, c2, c3) \
    00217                 ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \
    00218                 ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 ))
    00219
    00220 #if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
    00221 #define _strcmpi(a,b) strcmpi(a,b)
    00222 #endif
    00223
    00224 #endif // __IRR_TYPES_H_INCLUDED__
    00225

| The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Sun Oct 24 12:41:57 2010 by Doxygen (1.6.2)