Home | Namespaces | Hierarchy | Alphabetical List | Class list | Files | Namespace Members | Class members | File members | Tutorials
irrTypes.h
Go to the documentation of this file.
1 // Copyright (C) 2002-2010 Nikolaus Gebhardt
2 // This file is part of the "Irrlicht Engine".
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
4 
5 #ifndef __IRR_TYPES_H_INCLUDED__
6 #define __IRR_TYPES_H_INCLUDED__
7 
8 #include "IrrCompileConfig.h"
9 
10 namespace irr
11 {
12 
14 
15 #ifdef _MSC_VER
16 typedef unsigned __int8 u8;
17 #else
18 typedef unsigned char u8;
19 #endif
20 
22 
23 #ifdef _MSC_VER
24 typedef __int8 s8;
25 #else
26 typedef signed char s8;
27 #endif
28 
30 
31 typedef char c8;
32 
33 
34 
36 
37 #ifdef _MSC_VER
38 typedef unsigned __int16 u16;
39 #else
40 typedef unsigned short u16;
41 #endif
42 
44 
45 #ifdef _MSC_VER
46 typedef __int16 s16;
47 #else
48 typedef signed short s16;
49 #endif
50 
51 
52 
54 
55 #ifdef _MSC_VER
56 typedef unsigned __int32 u32;
57 #else
58 typedef unsigned int u32;
59 #endif
60 
62 
63 #ifdef _MSC_VER
64 typedef __int32 s32;
65 #else
66 typedef signed int s32;
67 #endif
68 
69 
70 
71 // 64 bit signed variable.
72 // This is a typedef for __int64, it ensures portability of the engine.
73 // This type is currently not used by the engine and not supported by compilers
74 // other than Microsoft Compilers, so it is outcommented.
75 //typedef __int64 s64;
76 
77 
78 
80 
81 typedef float f32;
82 
84 
85 typedef double f64;
86 
87 
88 } // end namespace irr
89 
90 
91 #include <wchar.h>
92 #ifdef _IRR_WINDOWS_API_
93 
94 
95 
96 
97 #if defined(_MSC_VER) && _MSC_VER > 1310 && !defined (_WIN32_WCE)
98 #define swprintf swprintf_s
99 #define snprintf sprintf_s
100 #else
101 #define swprintf _snwprintf
102 #define snprintf _snprintf
103 #endif
104 
105 // define the wchar_t type if not already built in.
106 #ifdef _MSC_VER
107 #ifndef _WCHAR_T_DEFINED
108 
109 
116 typedef unsigned short wchar_t;
117 #define _WCHAR_T_DEFINED
118 #endif // wchar is not defined
119 #endif // microsoft compiler
120 #endif // _IRR_WINDOWS_API_
121 
122 namespace irr
123 {
124 
126 
131 #if defined(_IRR_WCHAR_FILESYSTEM)
132  typedef wchar_t fschar_t;
133 #else
134  typedef char fschar_t;
135 #endif
136 
137 } // end namespace irr
138 
140 #if defined(_DEBUG)
141 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
142  #if defined(WIN64) || defined(_WIN64) // using portable common solution for x64 configuration
143  #include <crtdbg.h>
144  #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
145  #else
146  #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
147  #endif
148 #else
149 #include "assert.h"
150 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
151 #endif
152 #else
153 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
154 #endif
155 
157 
163 #if defined(IGNORE_DEPRECATED_WARNING)
164 #define _IRR_DEPRECATED_
165 #elif _MSC_VER >= 1310 //vs 2003 or higher
166 #define _IRR_DEPRECATED_ __declspec(deprecated)
167 #elif (__GNUC__ > 3 || (__GNUC__ == 3 && __GNUC_MINOR__ >= 1)) // all versions above 3.0 should support this feature
168 #define _IRR_DEPRECATED_ __attribute__ ((deprecated))
169 #else
170 #define _IRR_DEPRECATED_
171 #endif
172 
174 
179 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
180 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
181 #else
182 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
183 #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
184 
185 
186 // memory debugging
187 #if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \
188  (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE)
189 
190  #define CRTDBG_MAP_ALLOC
191  #define _CRTDBG_MAP_ALLOC
192  #define DEBUG_CLIENTBLOCK new( _CLIENT_BLOCK, __FILE__, __LINE__)
193  #include <stdlib.h>
194  #include <crtdbg.h>
195  #define new DEBUG_CLIENTBLOCK
196 #endif
197 
198 // disable truncated debug information warning in visual studio 6 by default
199 #if defined(_MSC_VER) && (_MSC_VER < 1300 )
200 #pragma warning( disable: 4786)
201 #endif // _MSC
202 
203 
205 
206 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400)
207  //#pragma warning( disable: 4996)
208  //#define _CRT_SECURE_NO_DEPRECATE 1
209  //#define _CRT_NONSTDC_NO_DEPRECATE 1
210 #endif
211 
212 
214 
216 #define MAKE_IRR_ID(c0, c1, c2, c3) \
217  ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \
218  ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 ))
219 
220 #if defined(__BORLANDC__) || defined (__BCPLUSPLUS__)
221 #define _strcmpi(a,b) strcmpi(a,b)
222 #endif
223 
224 #endif // __IRR_TYPES_H_INCLUDED__
225 

The Irrlicht Engine
The Irrlicht Engine Documentation © 2003-2010 by Nikolaus Gebhardt. Generated on Fri Mar 21 2014 04:40:17 by Doxygen (1.8.1.2)