diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/google/protobuf/stubs/int128.cc | 6 | ||||
-rw-r--r-- | src/google/protobuf/stubs/port.h | 4 |
2 files changed, 5 insertions, 5 deletions
diff --git a/src/google/protobuf/stubs/int128.cc b/src/google/protobuf/stubs/int128.cc index 3a36b4b1..a5090801 100644 --- a/src/google/protobuf/stubs/int128.cc +++ b/src/google/protobuf/stubs/int128.cc @@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) { std::streamsize div_base_log; switch (flags & std::ios::basefield) { case std::ios::hex: - div = GOOGLE_ULONGLONG(0x1000000000000000); // 16^15 + div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000)); // 16^15 div_base_log = 15; break; case std::ios::oct: - div = GOOGLE_ULONGLONG(01000000000000000000000); // 8^21 + div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000)); // 8^21 div_base_log = 21; break; default: // std::ios::dec - div = GOOGLE_ULONGLONG(10000000000000000000); // 10^19 + div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000)); // 10^19 div_base_log = 19; break; } diff --git a/src/google/protobuf/stubs/port.h b/src/google/protobuf/stubs/port.h index 371806f1..d7f93b4c 100644 --- a/src/google/protobuf/stubs/port.h +++ b/src/google/protobuf/stubs/port.h @@ -132,8 +132,8 @@ typedef uint64_t uint64; #define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...) #else // By long long, we actually mean int64. -#define GOOGLE_LONGLONG(x) INT64_C(x) -#define GOOGLE_ULONGLONG(x) UINT64_C(x) +#define GOOGLE_LONGLONG(x) x##LL +#define GOOGLE_ULONGLONG(x) x##ULL // Used to format real long long integers. #define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also. #endif |