diff options
author | Feng Xiao <xfxyjwf@gmail.com> | 2017-09-08 10:23:14 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-08 10:23:14 -0700 |
commit | 2ad5c0a86443f567241e0295c313baf4f0e15379 (patch) | |
tree | 3e2958a3e7063fdfbd80324563d733d7849b79cf | |
parent | 054054c1523342294d50460d652ad2c767df627f (diff) | |
parent | 1ee09c81bb721f5450909eb9ffccfef8facc740f (diff) | |
download | protobuf-2ad5c0a86443f567241e0295c313baf4f0e15379.tar.gz protobuf-2ad5c0a86443f567241e0295c313baf4f0e15379.tar.bz2 protobuf-2ad5c0a86443f567241e0295c313baf4f0e15379.zip |
Merge pull request #2576 from cristicbz/py-strutil
python: do not include internal 'strutil.h' header
-rw-r--r-- | python/google/protobuf/pyext/message.cc | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/python/google/protobuf/pyext/message.cc b/python/google/protobuf/pyext/message.cc index 702c5d03..43482c54 100644 --- a/python/google/protobuf/pyext/message.cc +++ b/python/google/protobuf/pyext/message.cc @@ -67,7 +67,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 @@ -102,6 +101,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> |