aboutsummaryrefslogtreecommitdiff
path: root/src/google/protobuf/stubs/int128.cc
diff options
context:
space:
mode:
authorJoshua Haberman <jhaberman@gmail.com>2018-09-07 16:15:38 -0700
committerGitHub <noreply@github.com>2018-09-07 16:15:38 -0700
commitf9d8138376765d229a32635c9209061e4e4aed8c (patch)
tree50719686fd7262f405c9bda8694d6c72e7c038b8 /src/google/protobuf/stubs/int128.cc
parent2e7563f40ec7f901ae8ae1cc749d701fa07e211d (diff)
parente53be9bce4556cf0d13e24f1a25a7d75f663144f (diff)
downloadprotobuf-f9d8138376765d229a32635c9209061e4e4aed8c.tar.gz
protobuf-f9d8138376765d229a32635c9209061e4e4aed8c.tar.bz2
protobuf-f9d8138376765d229a32635c9209061e4e4aed8c.zip
Merge pull request #5109 from haberman/integrate
Down-integrate from google3.
Diffstat (limited to 'src/google/protobuf/stubs/int128.cc')
-rw-r--r--src/google/protobuf/stubs/int128.cc17
1 files changed, 11 insertions, 6 deletions
diff --git a/src/google/protobuf/stubs/int128.cc b/src/google/protobuf/stubs/int128.cc
index 7b993e8f..f86ac4a0 100644
--- a/src/google/protobuf/stubs/int128.cc
+++ b/src/google/protobuf/stubs/int128.cc
@@ -34,12 +34,14 @@
#include <ostream> // NOLINT(readability/streams)
#include <sstream>
+#include <google/protobuf/port_def.inc>
+
namespace google {
namespace protobuf {
const uint128_pod kuint128max = {
- static_cast<uint64>(GOOGLE_LONGLONG(0xFFFFFFFFFFFFFFFF)),
- static_cast<uint64>(GOOGLE_LONGLONG(0xFFFFFFFFFFFFFFFF))
+ static_cast<uint64>(PROTOBUF_LONGLONG(0xFFFFFFFFFFFFFFFF)),
+ static_cast<uint64>(PROTOBUF_LONGLONG(0xFFFFFFFFFFFFFFFF))
};
// Returns the 0-based position of the last set bit (i.e., most significant bit)
@@ -63,7 +65,7 @@ static inline int Fls64(uint64 n) {
STEP(uint32, n32, pos, 0x10);
STEP(uint32, n32, pos, 0x08);
STEP(uint32, n32, pos, 0x04);
- return pos + ((GOOGLE_ULONGLONG(0x3333333322221100) >> (n32 << 2)) & 0x3);
+ return pos + ((PROTOBUF_ULONGLONG(0x3333333322221100) >> (n32 << 2)) & 0x3);
}
#undef STEP
@@ -129,15 +131,18 @@ std::ostream& operator<<(std::ostream& o, const uint128& b) {
std::streamsize div_base_log;
switch (flags & std::ios::basefield) {
case std::ios::hex:
- div = static_cast<uint64>(GOOGLE_ULONGLONG(0x1000000000000000)); // 16^15
+ div =
+ static_cast<uint64>(PROTOBUF_ULONGLONG(0x1000000000000000)); // 16^15
div_base_log = 15;
break;
case std::ios::oct:
- div = static_cast<uint64>(GOOGLE_ULONGLONG(01000000000000000000000)); // 8^21
+ div = static_cast<uint64>(
+ PROTOBUF_ULONGLONG(01000000000000000000000)); // 8^21
div_base_log = 21;
break;
default: // std::ios::dec
- div = static_cast<uint64>(GOOGLE_ULONGLONG(10000000000000000000)); // 10^19
+ div = static_cast<uint64>(
+ PROTOBUF_ULONGLONG(10000000000000000000)); // 10^19
div_base_log = 19;
break;
}