Skip to content

Commit

Permalink
Merge pull request #2269 from jaxfrank/main
Browse files Browse the repository at this point in the history
Fixed conflict with windows min() and max() macros in spirv_common.hpp
  • Loading branch information
HansKristian-Work authored Jan 23, 2024
2 parents 01c8a2a + e079567 commit bad97c8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions spirv_common.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -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<int32_t>::min())
if (value == (std::numeric_limits<int32_t>::min)())
return "int(0x80000000)";
else
return std::to_string(value);
Expand All @@ -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<int64_t>::min())
if (value == (std::numeric_limits<int64_t>::min)())
return join(int64_type, "(0x8000000000000000u", (long_long_literal_suffix ? "ll" : "l"), ")");
else
return std::to_string(value) + (long_long_literal_suffix ? "ll" : "l");
Expand Down

0 comments on commit bad97c8

Please sign in to comment.