aboutsummaryrefslogtreecommitdiff
path: root/python
diff options
context:
space:
mode:
authorCristi Cobzarenco <cristi.cobzarenco@gmail.com>2017-01-10 20:13:17 +0000
committerCristi Cobzarenco <cristi.cobzarenco@gmail.com>2017-01-28 12:19:11 +0200
commit1ee09c81bb721f5450909eb9ffccfef8facc740f (patch)
tree959475a8a7124ec6f6a1ceb77d27cf09da3ac3a2 /python
parenta83ac8663fb8042a881bc60b12a8bd3a0c03a3ff (diff)
downloadprotobuf-1ee09c81bb721f5450909eb9ffccfef8facc740f.tar.gz
protobuf-1ee09c81bb721f5450909eb9ffccfef8facc740f.tar.bz2
protobuf-1ee09c81bb721f5450909eb9ffccfef8facc740f.zip
python: do not include internal 'strutil.h' header
Diffstat (limited to 'python')
-rw-r--r--python/google/protobuf/pyext/message.cc12
1 files changed, 11 insertions, 1 deletions
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc
index 4f3abc84..ecd3d287 100644
--- a/python/google/protobuf/pyext/message.cc
+++ b/python/google/protobuf/pyext/message.cc
@@ -66,7 +66,6 @@
#include <google/protobuf/pyext/message_factory.h>
#include <google/protobuf/pyext/safe_numerics.h>
#include <google/protobuf/pyext/scoped_pyobject_ptr.h>
-#include <google/protobuf/stubs/strutil.h>
#if PY_MAJOR_VERSION >= 3
#define PyInt_AsLong PyLong_AsLong
@@ -101,6 +100,17 @@ namespace message_meta {
static int InsertEmptyWeakref(PyTypeObject* base);
+namespace {
+// Copied oveer from internal 'google/protobuf/stubs/strutil.h'.
+inline void UpperString(string * s) {
+ string::iterator end = s->end();
+ for (string::iterator i = s->begin(); i != end; ++i) {
+ // toupper() changes based on locale. We don't want this!
+ if ('a' <= *i && *i <= 'z') *i += 'A' - 'a';
+ }
+}
+}
+
// Add the number of a field descriptor to the containing message class.
// Equivalent to:
// _cls.<field>_FIELD_NUMBER = <number>