common_types.h 2.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061
  1. /**
  2. * Copyright (C) 2005-2012 Gekko Emulator
  3. *
  4. * @file common_types.h
  5. * @author ShizZy <shizzy247@gmail.com>
  6. * @date 2012-02-11
  7. * @brief Common types used throughout the project
  8. *
  9. * @section LICENSE
  10. * This program is free software; you can redistribute it and/or
  11. * modify it under the terms of the GNU General Public License as
  12. * published by the Free Software Foundation; either version 2 of
  13. * the License, or (at your option) any later version.
  14. *
  15. * This program is distributed in the hope that it will be useful, but
  16. * WITHOUT ANY WARRANTY; without even the implied warranty of
  17. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  18. * General Public License for more details at
  19. * http://www.gnu.org/copyleft/gpl.html
  20. *
  21. * Official project repository can be found at:
  22. * http://code.google.com/p/gekko-gc-emu/
  23. */
  24. #pragma once
  25. #include <cstdint>
  26. #ifdef _MSC_VER
  27. #ifndef __func__
  28. #define __func__ __FUNCTION__
  29. #endif
  30. #endif
  31. typedef std::uint8_t u8; ///< 8-bit unsigned byte
  32. typedef std::uint16_t u16; ///< 16-bit unsigned short
  33. typedef std::uint32_t u32; ///< 32-bit unsigned word
  34. typedef std::uint64_t u64; ///< 64-bit unsigned int
  35. typedef std::int8_t s8; ///< 8-bit signed byte
  36. typedef std::int16_t s16; ///< 16-bit signed short
  37. typedef std::int32_t s32; ///< 32-bit signed word
  38. typedef std::int64_t s64; ///< 64-bit signed int
  39. typedef float f32; ///< 32-bit floating point
  40. typedef double f64; ///< 64-bit floating point
  41. // TODO: It would be nice to eventually replace these with strong types that prevent accidental
  42. // conversion between each other.
  43. typedef u32 VAddr; ///< Represents a pointer in the userspace virtual address space.
  44. typedef u32 PAddr; ///< Represents a pointer in the ARM11 physical address space.
  45. // An inheritable class to disallow the copy constructor and operator= functions
  46. class NonCopyable {
  47. protected:
  48. constexpr NonCopyable() = default;
  49. ~NonCopyable() = default;
  50. NonCopyable(const NonCopyable&) = delete;
  51. NonCopyable& operator=(const NonCopyable&) = delete;
  52. };