check -> const_check to avoid a conflict with AssertMacros.h (#350)

(cherry picked from commit 8631694021)
This commit is contained in:
Victor Zverovich
2016-10-23 11:52:49 +02:00
committed by Jonathan Müller
parent 27f604a153
commit 3f778b2099
3 changed files with 16 additions and 15 deletions
+5 -4
View File
@@ -295,12 +295,13 @@ void TestLength(const char *length_spec, U value) {
fmt::LongLong signed_value = 0;
fmt::ULongLong unsigned_value = 0;
// Apply integer promotion to the argument.
fmt::ULongLong max = std::numeric_limits<U>::max();
using fmt::internal::check;
if (check(max <= static_cast<unsigned>(std::numeric_limits<int>::max()))) {
using std::numeric_limits;
fmt::ULongLong max = numeric_limits<U>::max();
using fmt::internal::const_check;
if (const_check(max <= static_cast<unsigned>(numeric_limits<int>::max()))) {
signed_value = static_cast<int>(value);
unsigned_value = static_cast<unsigned>(value);
} else if (check(max <= std::numeric_limits<unsigned>::max())) {
} else if (const_check(max <= numeric_limits<unsigned>::max())) {
signed_value = static_cast<unsigned>(value);
unsigned_value = static_cast<unsigned>(value);
}