Commit 2ad5c0a8 authored by Feng Xiao's avatar Feng Xiao Committed by GitHub

Merge pull request #2576 from cristicbz/py-strutil

python: do not include internal 'strutil.h' header
parents 054054c1 1ee09c81
......@@ -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>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment