#ifndef XNA_TYPES_HPP #define XNA_TYPES_HPP #include #include #include #include #include #include #include namespace xna { using Sbyte = int8_t; using Byte = uint8_t; using Short = int16_t; using Ushort = uint16_t; using Int = int32_t; using Uint = uint32_t; using Long = int64_t; using Ulong = uint64_t; using Char = char16_t; constexpr Sbyte SbyteMaxValue = (std::numeric_limits::max)(); constexpr Sbyte SbyteMinValue = (std::numeric_limits::min)(); constexpr Byte ByteMaxValue = (std::numeric_limits::max)(); constexpr Byte ByteMinValue = (std::numeric_limits::min)(); constexpr Short ShortMaxValue = (std::numeric_limits::max)(); constexpr Short ShortMinValue = (std::numeric_limits::min)(); constexpr Ushort UshortMaxValue = (std::numeric_limits::max)(); constexpr Ushort UshortMinValue = (std::numeric_limits::min)(); constexpr Int IntMaxValue = (std::numeric_limits::max)(); constexpr Int IntMinValue = (std::numeric_limits::min)(); constexpr Uint UintMaxValue = (std::numeric_limits::max)(); constexpr Uint UintMinValue = (std::numeric_limits::min)(); constexpr Long LongMaxValue = (std::numeric_limits::max)(); constexpr Long LongMinValue = (std::numeric_limits::min)(); constexpr Ulong UlongMaxValue = (std::numeric_limits::max)(); constexpr Ulong UlongMinValue = (std::numeric_limits::min)(); constexpr Char CharMaxValue = (std::numeric_limits::max)(); constexpr Char CharMinValue = (std::numeric_limits::min)(); constexpr float FloatMaxValue = (std::numeric_limits::max)(); constexpr float FloatMinValue = (std::numeric_limits::min)(); constexpr double DoubleMaxValue = (std::numeric_limits::max)(); constexpr double DoubleMinValue = (std::numeric_limits::min)(); using String = std::string; using WString = std::wstring; template using sptr = std::shared_ptr; template using uptr = std::unique_ptr; template inline std::shared_ptr<_Ty> New(_Types&&... _Args) { return std::make_shared<_Ty>(std::forward<_Types>(_Args)...); } template inline std::unique_ptr<_Ty> uNew(_Types&&... _Args) { return std::make_unique<_Ty>(std::forward<_Types>(_Args)...); } //See ref: https://en.cppreference.com/w/cpp/error/assert #define assertm(exp, msg) assert(((void)msg, exp)) } #endif