aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/google/protobuf/stubs
diff options
context:
space:
mode:
Diffstat (limited to 'src/google/protobuf/stubs')
-rw-r--r--src/google/protobuf/stubs/common.h8
-rw-r--r--src/google/protobuf/stubs/strutil.cc18
-rw-r--r--src/google/protobuf/stubs/strutil.h6
3 files changed, 8 insertions, 24 deletions
diff --git a/src/google/protobuf/stubs/common.h b/src/google/protobuf/stubs/common.h
index 37123c7b..3acaeba1 100644
--- a/src/google/protobuf/stubs/common.h
+++ b/src/google/protobuf/stubs/common.h
@@ -1141,6 +1141,14 @@ class LIBPROTOBUF_EXPORT Mutex {
GOOGLE_DISALLOW_EVIL_CONSTRUCTORS(Mutex);
};
+// Undefine the macros to workaround the conflicts with Google internal
+// MutexLock implementation.
+// TODO(liujisi): Remove the undef once internal macros are removed.
+#undef MutexLock
+#undef ReaderMutexLock
+#undef WriterMutexLock
+#undef MutexLockMaybe
+
// MutexLock(mu) acquires mu when constructed and releases it when destroyed.
class LIBPROTOBUF_EXPORT MutexLock {
public:
diff --git a/src/google/protobuf/stubs/strutil.cc b/src/google/protobuf/stubs/strutil.cc
index 7955d261..7ecc17ee 100644
--- a/src/google/protobuf/stubs/strutil.cc
+++ b/src/google/protobuf/stubs/strutil.cc
@@ -1285,24 +1285,6 @@ char* FloatToBuffer(float value, char* buffer) {
return buffer;
}
-string ToHex(uint64 num) {
- if (num == 0) {
- return string("0");
- }
-
- // Compute hex bytes in reverse order, writing to the back of the
- // buffer.
- char buf[16]; // No more than 16 hex digits needed.
- char* bufptr = buf + 16;
- static const char kHexChars[] = "0123456789abcdef";
- while (num != 0) {
- *--bufptr = kHexChars[num & 0xf];
- num >>= 4;
- }
-
- return string(bufptr, buf + 16 - bufptr);
-}
-
namespace strings {
AlphaNum::AlphaNum(strings::Hex hex) {
diff --git a/src/google/protobuf/stubs/strutil.h b/src/google/protobuf/stubs/strutil.h
index 920701eb..5faa81e0 100644
--- a/src/google/protobuf/stubs/strutil.h
+++ b/src/google/protobuf/stubs/strutil.h
@@ -683,12 +683,6 @@ string Join(const Range& components,
}
// ----------------------------------------------------------------------
-// ToHex()
-// Return a lower-case hex string representation of the given integer.
-// ----------------------------------------------------------------------
-LIBPROTOBUF_EXPORT string ToHex(uint64 num);
-
-// ----------------------------------------------------------------------
// GlobalReplaceSubstring()
// Replaces all instances of a substring in a string. Does nothing
// if 'substring' is empty. Returns the number of replacements.