/// @file core/types.h /// @brief The integer types of the engine, usable without `std::`. /// /// The standard library promises `size_t` and the fixed-width integers such as /// `uint32_t` in namespace std only. Whether the global names exist as well /// depends on the implementation and on which other headers happen to be /// included: libc++ (macOS) usually has them, libstdc++ (GNU) often does not, /// so code that compiled on one failed on the other. /// /// This header settles it in one place. It includes the headers that declare /// the types and brings the names into the global namespace. Every file of the /// engine that uses them includes this header, and writes the plain names. /// /// A using-declaration is fine when the global name already exists: it names /// the same type, and libstdc++ does the same in its own ``. #pragma once #include #include using std::ptrdiff_t; using std::size_t; using std::int16_t; using std::int32_t; using std::int64_t; using std::int8_t; using std::intptr_t; using std::uint16_t; using std::uint32_t; using std::uint64_t; using std::uint8_t; using std::uintptr_t; // What the rest of the engine takes for granted. If a platform ever differs, // the build stops here instead of computing something else. static_assert(sizeof(int) == 4, "Kumo assumes a 32-bit int"); static_assert(sizeof(void*) == 8, "Kumo assumes a 64-bit platform");