From 1ee09c81bb721f5450909eb9ffccfef8facc740f Mon Sep 17 00:00:00 2001 From: Cristi Cobzarenco Date: Tue, 10 Jan 2017 20:13:17 +0000 Subject: python: do not include internal 'strutil.h' header --- python/google/protobuf/pyext/message.cc | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'python') 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 #include #include -#include #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_NUMBER = -- cgit v1.2.3