1 // Copyright (C) 2002-2012 Nikolaus Gebhardt
\r
2 // This file is part of the "Irrlicht Engine".
\r
3 // For conditions of distribution and use, see copyright notice in irrlicht.h
\r
5 #ifndef __IRR_TYPES_H_INCLUDED__
\r
6 #define __IRR_TYPES_H_INCLUDED__
\r
8 #include "IrrCompileConfig.h"
\r
14 //! 8 bit unsigned variable.
\r
17 //! 8 bit signed variable.
\r
20 //! 8 bit character variable.
\r
21 /** This is a typedef for char, it ensures portability of the engine. */
\r
26 //! 16 bit unsigned variable.
\r
27 typedef uint16_t u16;
\r
29 //! 16 bit signed variable.
\r
30 typedef int16_t s16;
\r
34 //! 32 bit unsigned variable.
\r
35 typedef uint32_t u32;
\r
37 //! 32 bit signed variable.
\r
38 typedef int32_t s32;
\r
41 #ifdef __IRR_HAS_S64
\r
42 //! 64 bit unsigned variable.
\r
43 typedef uint64_t u64;
\r
45 //! 64 bit signed variable.
\r
46 typedef int64_t s64;
\r
47 #endif // __IRR_HAS_S64
\r
51 //! 32 bit floating point variable.
\r
52 /** This is a typedef for float, it ensures portability of the engine. */
\r
55 //! 64 bit floating point variable.
\r
56 /** This is a typedef for double, it ensures portability of the engine. */
\r
60 } // end namespace irr
\r
64 //! Defines for s{w,n}printf_irr because s{w,n}printf methods do not match the ISO C
\r
65 //! standard on Windows platforms.
\r
66 //! We want int snprintf_irr(char *str, size_t size, const char *format, ...);
\r
67 //! and int swprintf_irr(wchar_t *wcs, size_t maxlen, const wchar_t *format, ...);
\r
68 #if defined(_MSC_VER)
\r
69 #define swprintf_irr swprintf_s
\r
70 #define snprintf_irr sprintf_s
\r
72 #define swprintf_irr swprintf
\r
73 #define snprintf_irr snprintf
\r
79 //! Type name for character type used by the file system.
\r
80 typedef char fschar_t;
\r
81 #define _IRR_TEXT(X) X
\r
83 } // end namespace irr
\r
85 //! define a break macro for debugging.
\r
87 #if defined(_IRR_WINDOWS_API_) && defined(_MSC_VER)
\r
89 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_CrtDbgBreak();}
\r
92 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) assert( !(_CONDITION_) );
\r
95 #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
\r
98 //! Defines a deprecated macro which generates a warning at compile time
\r
99 /** The usage is simple
\r
100 For typedef: typedef _IRR_DEPRECATED_ int test1;
\r
101 For classes/structs: class _IRR_DEPRECATED_ test2 { ... };
\r
102 For methods: class test3 { _IRR_DEPRECATED_ virtual void foo() {} };
\r
103 For functions: template<class T> _IRR_DEPRECATED_ void test4(void) {}
\r
105 #if defined(IGNORE_DEPRECATED_WARNING)
\r
106 #define _IRR_DEPRECATED_
\r
107 #elif defined(_MSC_VER)
\r
108 #define _IRR_DEPRECATED_ __declspec(deprecated)
\r
109 #elif defined(__GNUC__)
\r
110 #define _IRR_DEPRECATED_ __attribute__ ((deprecated))
\r
112 #define _IRR_DEPRECATED_
\r
115 //! deprecated macro for virtual function override
\r
116 /** prefer to use the override keyword for new code */
\r
117 #define _IRR_OVERRIDE_ override
\r
119 //! creates four CC codes used in Irrlicht for simple ids
\r
120 /** some compilers can create those by directly writing the
\r
121 code like 'code', but some generate warnings so we use this macro here */
\r
122 #define MAKE_IRR_ID(c0, c1, c2, c3) \
\r
123 ((irr::u32)(irr::u8)(c0) | ((irr::u32)(irr::u8)(c1) << 8) | \
\r
124 ((irr::u32)(irr::u8)(c2) << 16) | ((irr::u32)(irr::u8)(c3) << 24 ))
\r
126 #endif // __IRR_TYPES_H_INCLUDED__
\r