From c7621669743bb08c79af06ee6f72efc2654c40d7 Mon Sep 17 00:00:00 2001 From: bubnikv <bubnikv@gmail.com> Date: Tue, 25 Sep 2018 12:43:53 +0200 Subject: [PATCH] size_t is not uint32_t or uint64_t on GCC --- src/libslic3r/Utils.hpp | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/libslic3r/Utils.hpp b/src/libslic3r/Utils.hpp index f7d9e68c1..3e4437fcc 100644 --- a/src/libslic3r/Utils.hpp +++ b/src/libslic3r/Utils.hpp @@ -110,6 +110,17 @@ inline uint64_t next_highest_power_of_2(uint64_t v) return ++ v; } +#ifdef __GNUC__ +inline size_t next_highest_power_of_2(size_t v) +{ +#if sizeof(size_t) == sizeof(uint32_t) + return next_highest_power_of_2(uint32_t(v)); +#else + return next_highest_power_of_2(uint64_t(v)); +#endif +} +#endif + extern std::string xml_escape(std::string text); } // namespace Slic3r