irrTypes.h 3.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101
  1. // Copyright (C) 2002-2005 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. #ifndef __IRR_TYPES_H_INCLUDED__
  5. #define __IRR_TYPES_H_INCLUDED__
  6. namespace irr
  7. {
  8. //! 8 bit unsigned variable.
  9. /** This is a typedef for unsigned char, it ensures portability of the engine. */
  10. typedef unsigned char u8;
  11. //! 8 bit signed variable.
  12. /** This is a typedef for signed char, it ensures portability of the engine. */
  13. typedef signed char s8;
  14. //! 8 bit character variable.
  15. /** This is a typedef for char, it ensures portability of the engine. */
  16. typedef char c8;
  17. //! 16 bit unsigned variable.
  18. /** This is a typedef for unsigned short, it ensures portability of the engine. */
  19. typedef unsigned short u16;
  20. //! 16 bit signed variable.
  21. /** This is a typedef for signed short, it ensures portability of the engine. */
  22. typedef signed short s16;
  23. //! 32 bit unsigned variable.
  24. /** This is a typedef for unsigned int, it ensures portability of the engine. */
  25. typedef unsigned int u32;
  26. //! 32 bit signed variable.
  27. /** This is a typedef for signed int, it ensures portability of the engine. */
  28. typedef signed int s32;
  29. // 64 bit signed variable.
  30. // This is a typedef for __int64, it ensures portability of the engine.
  31. // This type is currently not used by the engine and not supported by compilers
  32. // other than Microsoft Compilers, so it is outcommented.
  33. //typedef __int64 s64;
  34. //! 32 bit floating point variable.
  35. /** This is a typedef for float, it ensures portability of the engine. */
  36. typedef float f32;
  37. //! 64 bit floating point variable.
  38. /** This is a typedef for double, it ensures portability of the engine. */
  39. typedef double f64;
  40. } // end namespace
  41. // define the wchar_t type if not already built in.
  42. #ifdef _MSC_VER
  43. #ifndef _WCHAR_T_DEFINED
  44. //! A 16 bit wide character type.
  45. /**
  46. Defines the wchar_t-type.
  47. In VS6, its not possible to tell
  48. the standard compiler to treat wchar_t as a built-in type, and
  49. sometimes we just don't want to include the huge stdlib.h or wchar.h,
  50. so we'll use this.
  51. */
  52. typedef unsigned short wchar_t;
  53. #define _WCHAR_T_DEFINED
  54. #endif // wchar is not defined
  55. #endif // microsoft compiler
  56. //! define a break macro for debugging only in Win32 mode.
  57. #if !defined(_WIN64) && defined(WIN32) && defined(_MSC_VER) && defined(_DEBUG)
  58. #define _IRR_DEBUG_BREAK_IF( _CONDITION_ ) if (_CONDITION_) {_asm int 3}
  59. #else
  60. #define _IRR_DEBUG_BREAK_IF( _CONDITION_ )
  61. #endif
  62. //! Defines a small statement to work around a microsoft compiler bug.
  63. /** The microsft compiler 7.0 - 7.1 has a bug:
  64. When you call unmanaged code that returns a bool type value of false from managed code,
  65. the return value may appear as true. See
  66. http://support.microsoft.com/default.aspx?kbid=823071 for details.
  67. Compiler version defines: VC6.0 : 1200, VC7.0 : 1300, VC7.1 : 1310, VC8.0 : 1400*/
  68. #if !defined(_WIN64) && defined(WIN32) && defined(_MSC_VER) && (_MSC_VER > 1299) && (_MSC_VER < 1400)
  69. #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX __asm mov eax,100
  70. #else
  71. #define _IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX
  72. #endif // _IRR_MANAGED_MARSHALLING_BUGFIX
  73. #endif // __IRR_TYPES_H_INCLUDED__