|
@@ -66,7 +66,6 @@
|
|
#include <google/protobuf/pyext/message_factory.h>
|
|
#include <google/protobuf/pyext/message_factory.h>
|
|
#include <google/protobuf/pyext/safe_numerics.h>
|
|
#include <google/protobuf/pyext/safe_numerics.h>
|
|
#include <google/protobuf/pyext/scoped_pyobject_ptr.h>
|
|
#include <google/protobuf/pyext/scoped_pyobject_ptr.h>
|
|
-#include <google/protobuf/stubs/strutil.h>
|
|
|
|
|
|
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#if PY_MAJOR_VERSION >= 3
|
|
#define PyInt_AsLong PyLong_AsLong
|
|
#define PyInt_AsLong PyLong_AsLong
|
|
@@ -101,6 +100,17 @@ namespace message_meta {
|
|
|
|
|
|
static int InsertEmptyWeakref(PyTypeObject* base);
|
|
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.
|
|
// Add the number of a field descriptor to the containing message class.
|
|
// Equivalent to:
|
|
// Equivalent to:
|
|
// _cls.<field>_FIELD_NUMBER = <number>
|
|
// _cls.<field>_FIELD_NUMBER = <number>
|