A port of the irrlicht XML parser library.
irrTypes.h@0:41a49a73580c, 2010-11-17 (annotated)
- Committer:
- hlipka
- Date:
- Wed Nov 17 20:19:41 2010 +0000
- Revision:
- 0:41a49a73580c
initial version
Who changed what in which revision?
User | Revision | Line number | New contents of line |
---|---|---|---|
hlipka | 0:41a49a73580c | 1 | // Copyright (C) 2002-2005 Nikolaus Gebhardt |
hlipka | 0:41a49a73580c | 2 | // This file is part of the "Irrlicht Engine". |
hlipka | 0:41a49a73580c | 3 | // For conditions of distribution and use, see copyright notice in irrlicht.h |
hlipka | 0:41a49a73580c | 4 | |
hlipka | 0:41a49a73580c | 5 | #ifndef __IRR_TYPES_H_INCLUDED__ |
hlipka | 0:41a49a73580c | 6 | #define __IRR_TYPES_H_INCLUDED__ |
hlipka | 0:41a49a73580c | 7 | |
hlipka | 0:41a49a73580c | 8 | namespace irr |
hlipka | 0:41a49a73580c | 9 | { |
hlipka | 0:41a49a73580c | 10 | |
hlipka | 0:41a49a73580c | 11 | //! 8 bit unsigned variable. |
hlipka | 0:41a49a73580c | 12 | /** This is a typedef for unsigned char, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 13 | typedef unsigned char u8; |
hlipka | 0:41a49a73580c | 14 | |
hlipka | 0:41a49a73580c | 15 | //! 8 bit signed variable. |
hlipka | 0:41a49a73580c | 16 | /** This is a typedef for signed char, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 17 | typedef signed char s8; |
hlipka | 0:41a49a73580c | 18 | |
hlipka | 0:41a49a73580c | 19 | //! 8 bit character variable. |
hlipka | 0:41a49a73580c | 20 | /** This is a typedef for char, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 21 | typedef char c8; |
hlipka | 0:41a49a73580c | 22 | |
hlipka | 0:41a49a73580c | 23 | |
hlipka | 0:41a49a73580c | 24 | |
hlipka | 0:41a49a73580c | 25 | //! 16 bit unsigned variable. |
hlipka | 0:41a49a73580c | 26 | /** This is a typedef for unsigned short, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 27 | typedef unsigned short u16; |
hlipka | 0:41a49a73580c | 28 | |
hlipka | 0:41a49a73580c | 29 | //! 16 bit signed variable. |
hlipka | 0:41a49a73580c | 30 | /** This is a typedef for signed short, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 31 | typedef signed short s16; |
hlipka | 0:41a49a73580c | 32 | |
hlipka | 0:41a49a73580c | 33 | |
hlipka | 0:41a49a73580c | 34 | |
hlipka | 0:41a49a73580c | 35 | //! 32 bit unsigned variable. |
hlipka | 0:41a49a73580c | 36 | /** This is a typedef for unsigned int, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 37 | typedef unsigned int u32; |
hlipka | 0:41a49a73580c | 38 | |
hlipka | 0:41a49a73580c | 39 | //! 32 bit signed variable. |
hlipka | 0:41a49a73580c | 40 | /** This is a typedef for signed int, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 41 | typedef signed int s32; |
hlipka | 0:41a49a73580c | 42 | |
hlipka | 0:41a49a73580c | 43 | |
hlipka | 0:41a49a73580c | 44 | |
hlipka | 0:41a49a73580c | 45 | // 64 bit signed variable. |
hlipka | 0:41a49a73580c | 46 | // This is a typedef for __int64, it ensures portability of the engine. |
hlipka | 0:41a49a73580c | 47 | // This type is currently not used by the engine and not supported by compilers |
hlipka | 0:41a49a73580c | 48 | // other than Microsoft Compilers, so it is outcommented. |
hlipka | 0:41a49a73580c | 49 | //typedef __int64 s64; |
hlipka | 0:41a49a73580c | 50 | |
hlipka | 0:41a49a73580c | 51 | |
hlipka | 0:41a49a73580c | 52 | |
hlipka | 0:41a49a73580c | 53 | //! 32 bit floating point variable. |
hlipka | 0:41a49a73580c | 54 | /** This is a typedef for float, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 55 | typedef float f32; |
hlipka | 0:41a49a73580c | 56 | |
hlipka | 0:41a49a73580c | 57 | //! 64 bit floating point variable. |
hlipka | 0:41a49a73580c | 58 | /** This is a typedef for double, it ensures portability of the engine. */ |
hlipka | 0:41a49a73580c | 59 | typedef double f64; |
hlipka | 0:41a49a73580c | 60 | |
hlipka | 0:41a49a73580c | 61 | |
hlipka | 0:41a49a73580c | 62 | } // end namespace |
hlipka | 0:41a49a73580c | 63 | |
hlipka | 0:41a49a73580c | 64 | |
hlipka | 0:41a49a73580c | 65 | // define the wchar_t type if not already built in. |
hlipka | 0:41a49a73580c | 66 | #ifdef _MSC_VER |
hlipka | 0:41a49a73580c | 67 | #ifndef _WCHAR_T_DEFINED |
hlipka | 0:41a49a73580c | 68 | //! A 16 bit wide character type. |
hlipka | 0:41a49a73580c | 69 | /** |
hlipka | 0:41a49a73580c | 70 | Defines the wchar_t-type. |
hlipka | 0:41a49a73580c | 71 | In VS6, its not possible to tell |
hlipka | 0:41a49a73580c | 72 | the standard compiler to treat wchar_t as a built-in type, and |
hlipka | 0:41a49a73580c | 73 | sometimes we just don't want to include the huge stdlib.h or wchar.h, |
hlipka | 0:41a49a73580c | 74 | so we'll use this. |
hlipka | 0:41a49a73580c | 75 | */ |
hlipka | 0:41a49a73580c | 76 | typedef unsigned short wchar_t; |
hlipka | 0:41a49a73580c | 77 | #define _WCHAR_T_DEFINED |
hlipka | 0:41a49a73580c | 78 | #endif // wchar is not defined |
hlipka | 0:41a49a73580c | 79 | #endif // microsoft compiler |
hlipka | 0:41a49a73580c | 80 | |
hlipka | 0:41a49a73580c | 81 | //! define a break macro for debugging only in Win32 mode. |
hlipka | 0:41a49a73580c | 82 | #if defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG) |
hlipka | 0:41a49a73580c | 83 | #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3} |
hlipka | 0:41a49a73580c | 84 | #else |
hlipka | 0:41a49a73580c | 85 | #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) |
hlipka | 0:41a49a73580c | 86 | #endif |
hlipka | 0:41a49a73580c | 87 | |
hlipka | 0:41a49a73580c | 88 | //! Defines a small statement to work around a microsoft compiler bug. |
hlipka | 0:41a49a73580c | 89 | /** The microsft compiler 7.0 - 7.1 has a bug: |
hlipka | 0:41a49a73580c | 90 | When you call unmanaged code that returns a bool type value of false from managed code, |
hlipka | 0:41a49a73580c | 91 | the return value may appear as true. See |
hlipka | 0:41a49a73580c | 92 | http://support.microsoft.com/default.aspx?kbid=823071 for details. |
hlipka | 0:41a49a73580c | 93 | Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/ |
hlipka | 0:41a49a73580c | 94 | #if defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400) |
hlipka | 0:41a49a73580c | 95 | #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100 |
hlipka | 0:41a49a73580c | 96 | #else |
hlipka | 0:41a49a73580c | 97 | #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX |
hlipka | 0:41a49a73580c | 98 | #endif // _IRR_MANAGED_MARSHALLING_BUGFIX |
hlipka | 0:41a49a73580c | 99 | |
hlipka | 0:41a49a73580c | 100 | #endif // __IRR_TYPES_H_INCLUDED__ |