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

irrTypes.h

Go to the documentation of this file.
00001 // Copyright (C) 2002-2007 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 
00123 #if defined(_DEBUG)
00124 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && !defined (_WIN32_WCE)
00125   #if defined(_WIN64) // using portable common solution for x64 configuration
00126   #include <crtdbg.h>
00127   #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
00128   #else
00129   #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
00130   #endif
00131 #else 
00132 #include "assert.h"
00133 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
00134 #endif
00135 #else 
00136 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
00137 #endif
00138 
00140 
00145 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
00146 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
00147 #else
00148 #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
00149 #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
00150 
00151 
00152 // memory debugging
00153 #if defined(_DEBUG) && defined(IRRLICHT_EXPORTS) && defined(_MSC_VER) && \
00154         (_MSC_VER > 1299) && !defined(_IRR_DONT_DO_MEMORY_DEBUGGING_HERE) && !defined(_WIN32_WCE)
00155         
00156         #define CRTDBG_MAP_ALLOC
00157         #define _CRTDBG_MAP_ALLOC
00158         #define DEBUG_CLIENTBLOCK   new( _CLIENT_BLOCK, __FILE__, __LINE__)
00159         #include <stdlib.h>
00160         #include <crtdbg.h>
00161         #define new DEBUG_CLIENTBLOCK
00162 #endif 
00163 
00164 // disable truncated debug information warning in visual studio 6 by default
00165 #if defined(_MSC_VER) && (_MSC_VER < 1300 )
00166 #pragma warning( disable: 4786)
00167 #endif // _MSC
00168 
00169 
00171 
00172 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER) && (_MSC_VER >= 1400)
00173         //#pragma warning( disable: 4996)
00174         //#define _CRT_SECURE_NO_DEPRECATE 1
00175         //#define _CRT_NONSTDC_NO_DEPRECATE 1
00176 #endif
00177 
00178 
00180 
00182 #define MAKE_IRR_ID(c0, c1, c2, c3)                       \
00183                 ((u32)(u8)(c0) | ((u32)(u8)(c1) << 8) |   \
00184                 ((u32)(u8)(c2) << 16) | ((u32)(u8)(c3) << 24 ))
00185 
00186 
00187 #endif // __IRR_TYPES_H_INCLUDED__
00188 
00189 

The NUSoftware Game Engine
The NUSoftware Game Engine Documentation © 2007-2008 by Tomer Nosrati. Generated on Sat Apr 26 16:52:34 2008 by Doxygen (1.5.5)