Index: third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc |
diff --git a/third_party/protobuf/src/google/protobuf/arenastring.cc b/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc |
similarity index 65% |
rename from third_party/protobuf/src/google/protobuf/arenastring.cc |
rename to third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc |
index cce61d74de241401917ef30c8a5a707fed10e177..1b1ab5d1dc7f4bf986884718c67d69a460232ada 100644 |
--- a/third_party/protobuf/src/google/protobuf/arenastring.cc |
+++ b/third_party/protobuf/python/google/protobuf/pyext/python_protobuf.cc |
@@ -1,6 +1,6 @@ |
// Protocol Buffers - Google's data interchange format |
// Copyright 2008 Google Inc. All rights reserved. |
-// https://developers.google.com/protocol-buffers/ |
+// http://code.google.com/p/protobuf/ |
// |
// Redistribution and use in source and binary forms, with or without |
// modification, are permitted provided that the following conditions are |
@@ -28,26 +28,36 @@ |
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE |
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. |
-// The ArenaString implementation is not included in the open-source release. Do |
-// not include this file in the distribution. |
+// Author: qrczak@google.com (Marcin Kowalczyk) |
-#include <google/protobuf/arenastring.h> |
+#include <google/protobuf/pyext/python_protobuf.h> |
namespace google { |
namespace protobuf { |
-namespace internal { |
+namespace python { |
+static const Message* GetCProtoInsidePyProtoStub(PyObject* msg) { |
+ return NULL; |
+} |
+static Message* MutableCProtoInsidePyProtoStub(PyObject* msg) { |
+ return NULL; |
+} |
-void ArenaStringPtr::AssignWithDefault(const ::std::string* default_value, |
- ArenaStringPtr value) { |
- const ::std::string* me = *UnsafeRawStringPointer(); |
- const ::std::string* other = *value.UnsafeRawStringPointer(); |
- // If the pointers are the same then do nothing. |
- if (me != other) { |
- SetNoArena(default_value, value.GetNoArena(default_value)); |
- } |
+// This is initialized with a default, stub implementation. |
+// If python-google.protobuf.cc is loaded, the function pointer is overridden |
+// with a full implementation. |
+const Message* (*GetCProtoInsidePyProtoPtr)(PyObject* msg) = |
+ GetCProtoInsidePyProtoStub; |
+Message* (*MutableCProtoInsidePyProtoPtr)(PyObject* msg) = |
+ MutableCProtoInsidePyProtoStub; |
+ |
+const Message* GetCProtoInsidePyProto(PyObject* msg) { |
+ return GetCProtoInsidePyProtoPtr(msg); |
+} |
+Message* MutableCProtoInsidePyProto(PyObject* msg) { |
+ return MutableCProtoInsidePyProtoPtr(msg); |
} |
-} // namespace internal |
+} // namespace python |
} // namespace protobuf |
} // namespace google |