// The following assertion does not build on Mac and Android. This is because
// static_assert only works with compile-time constants, but mac uses
// libstdc++4.2 and android uses stlport, which both don't mark
-// numeric_limits::max() as constexp.
-#if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && !defined(OS_IOS)
+// numeric_limits::max() as constexp. Likewise, MSVS2013's standard library
+// also doesn't mark max() as constexpr yet. cl.exe supports static_cast but
+// doesn't really implement constexpr yet so it doesn't complain, but clang
+// does.
+#if __cplusplus >= 201103 && !defined(OS_ANDROID) && !defined(OS_MACOSX) && \
+ !defined(OS_IOS) && !(defined(__clang__) && defined(OS_WIN))
COMPILE_ASSERT(kSSizeMaxConst == \
static_cast<size_t>(std::numeric_limits<ssize_t>::max()),
kSSizeMax_is_the_max_value_of_an_ssize_t);
buffer.Pad(' ', padding, 1);
// Convert the argument to an ASCII character and output it.
- char ch = static_cast<char>(arg.i);
+ char ch = static_cast<char>(arg.integer.i);
if (!ch) {
goto end_of_output_buffer;
}
DEBUG_CHECK(arg.type == Arg::INT || arg.type == Arg::UINT);
goto fail_to_expand;
}
- i = arg.i;
+ i = arg.integer.i;
if (ch != 'd') {
// The Arg() constructor automatically performed sign expansion on
// We have to do this here, instead of in the Arg() constructor, as
// the Arg() constructor cannot tell whether we will output a %d
// or a %x. Only the latter should experience masking.
- if (arg.width < sizeof(int64_t)) {
- i &= (1LL << (8*arg.width)) - 1;
+ if (arg.integer.width < sizeof(int64_t)) {
+ i &= (1LL << (8*arg.integer.width)) - 1;
}
}
} else {
i = reinterpret_cast<uintptr_t>(arg.ptr);
} else if (arg.type == Arg::STRING) {
i = reinterpret_cast<uintptr_t>(arg.str);
- } else if (arg.type == Arg::INT && arg.width == sizeof(NULL) &&
- arg.i == 0) { // Allow C++'s version of NULL
+ } else if (arg.type == Arg::INT &&
+ arg.integer.width == sizeof(NULL) &&
+ arg.integer.i == 0) { // Allow C++'s version of NULL
i = 0;
} else {
DEBUG_CHECK(arg.type == Arg::POINTER || arg.type == Arg::STRING);
const char *s;
if (arg.type == Arg::STRING) {
s = arg.str ? arg.str : "<NULL>";
- } else if (arg.type == Arg::INT && arg.width == sizeof(NULL) &&
- arg.i == 0) { // Allow C++'s version of NULL
+ } else if (arg.type == Arg::INT && arg.integer.width == sizeof(NULL) &&
+ arg.integer.i == 0) { // Allow C++'s version of NULL
s = "<NULL>";
} else {
DEBUG_CHECK(arg.type == Arg::STRING);