From 4d9a82b720c8ce74b94f43f72ddd819ef21abbdf Mon Sep 17 00:00:00 2001 From: Stanislaw Halik Date: Sat, 18 Mar 2023 23:42:07 +0100 Subject: pre-declare integer types without cstddef/cstdint --- serialize/magnum-vector2i.hpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'serialize/magnum-vector2i.hpp') diff --git a/serialize/magnum-vector2i.hpp b/serialize/magnum-vector2i.hpp index f63bd130..aa2c3939 100644 --- a/serialize/magnum-vector2i.hpp +++ b/serialize/magnum-vector2i.hpp @@ -14,7 +14,7 @@ struct adl_serializer> final static void to_json(json& j, const Magnum::Math::Vector2& val) { char buf[64]; - using type = std::conditional_t, std::intmax_t, std::uintmax_t>; + using type = std::conditional_t, intmax_t, uintmax_t>; constexpr auto format_string = std::is_signed_v ? "%jd x %jd" : "%ju x %ju"; snprintf(buf, sizeof(buf), format_string, (type)val[0], (type)val[1]); j = buf; @@ -23,12 +23,12 @@ struct adl_serializer> final { using namespace floormat; std::string str = j; - using type = std::conditional_t, std::intmax_t, std::uintmax_t>; + using type = std::conditional_t, intmax_t, uintmax_t>; constexpr auto format_string = std::is_signed_v ? "%jd x %jd%n" : "%ju x %ju%n"; type x = 0, y = 0; int n = 0; int ret = std::sscanf(str.data(), format_string, &x, &y, &n); - if (ret != 2 || (std::size_t)n != str.size() || x != (t)x || y != (t)y) + if (ret != 2 || (size_t)n != str.size() || x != (t)x || y != (t)y) fm_throw("failed to parse Vector2 '{}'"_cf, str); val = { (t)x, (t)y }; } -- cgit v1.2.3