Commit 12581b4c authored by Feng Xiao's avatar Feng Xiao

Fixes traivs cpp build.

Remove the use of INT64_C/UINT64_C and add static_cast when neccessary.
parent 234ec017
...@@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) { ...@@ -145,15 +145,15 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) {
std::streamsize div_base_log; std::streamsize div_base_log;
switch (flags & std::ios::basefield) { switch (flags & std::ios::basefield) {
case std::ios::hex: case std::ios::hex:
div = GOOGLE_ULONGLONG(0x1000000000000000); // 16^15 div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000)); // 16^15
div_base_log = 15; div_base_log = 15;
break; break;
case std::ios::oct: case std::ios::oct:
div = GOOGLE_ULONGLONG(01000000000000000000000); // 8^21 div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000)); // 8^21
div_base_log = 21; div_base_log = 21;
break; break;
default: // std::ios::dec default: // std::ios::dec
div = GOOGLE_ULONGLONG(10000000000000000000); // 10^19 div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000)); // 10^19
div_base_log = 19; div_base_log = 19;
break; break;
} }
......
...@@ -132,8 +132,8 @@ typedef uint64_t uint64; ...@@ -132,8 +132,8 @@ typedef uint64_t uint64;
#define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...) #define GOOGLE_LL_FORMAT "I64" // As in printf("%I64d", ...)
#else #else
// By long long, we actually mean int64. // By long long, we actually mean int64.
#define GOOGLE_LONGLONG(x) INT64_C(x) #define GOOGLE_LONGLONG(x) x##LL
#define GOOGLE_ULONGLONG(x) UINT64_C(x) #define GOOGLE_ULONGLONG(x) x##ULL
// Used to format real long long integers. // Used to format real long long integers.
#define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also. #define GOOGLE_LL_FORMAT "ll" // As in "%lld". Note that "q" is poor form also.
#endif #endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment