diff --git a/spirv_common.hpp b/spirv_common.hpp index 0cdbda23..51fffe7a 100644 --- a/spirv_common.hpp +++ b/spirv_common.hpp @@ -220,7 +220,7 @@ static inline std::string convert_to_string(int32_t value) // INT_MIN is ... special on some backends. If we use a decimal literal, and negate it, we // could accidentally promote the literal to long first, then negate. // To workaround it, emit int(0x80000000) instead. - if (value == std::numeric_limits::min()) + if (value == (std::numeric_limits::min)()) return "int(0x80000000)"; else return std::to_string(value); @@ -231,7 +231,7 @@ static inline std::string convert_to_string(int64_t value, const std::string &in // INT64_MIN is ... special on some backends. // If we use a decimal literal, and negate it, we might overflow the representable numbers. // To workaround it, emit int(0x80000000) instead. - if (value == std::numeric_limits::min()) + if (value == (std::numeric_limits::min)()) return join(int64_type, "(0x8000000000000000u", (long_long_literal_suffix ? "ll" : "l"), ")"); else return std::to_string(value) + (long_long_literal_suffix ? "ll" : "l");