Internal change only

PiperOrigin-RevId: 491993057
pull/11098/head
Jie Luo 2 years ago committed by Copybara-Service
parent 85debe8400
commit 3d3bebf8ab
  1. 0
      python/google/protobuf/descriptor.py
  2. 7
      python/google/protobuf/internal/api_implementation.py
  3. 0
      python/google/protobuf/internal/containers.py
  4. 0
      python/google/protobuf/internal/decoder.py
  5. 0
      python/google/protobuf/internal/encoder.py
  6. 0
      python/google/protobuf/internal/python_message.py
  7. 2
      python/google/protobuf/internal/python_protobuf.cc
  8. 7
      python/google/protobuf/internal/test_util.py
  9. 0
      python/google/protobuf/internal/type_checkers.py
  10. 0
      python/google/protobuf/message.py
  11. 6
      python/google/protobuf/proto_api.h
  12. 12
      python/google/protobuf/pyext/descriptor.cc
  13. 6
      python/google/protobuf/pyext/descriptor.h
  14. 8
      python/google/protobuf/pyext/descriptor_containers.cc
  15. 6
      python/google/protobuf/pyext/descriptor_containers.h
  16. 6
      python/google/protobuf/pyext/descriptor_database.cc
  17. 6
      python/google/protobuf/pyext/descriptor_database.h
  18. 13
      python/google/protobuf/pyext/descriptor_pool.cc
  19. 6
      python/google/protobuf/pyext/descriptor_pool.h
  20. 14
      python/google/protobuf/pyext/extension_dict.cc
  21. 8
      python/google/protobuf/pyext/extension_dict.h
  22. 6
      python/google/protobuf/pyext/field.cc
  23. 6
      python/google/protobuf/pyext/field.h
  24. 10
      python/google/protobuf/pyext/map_container.cc
  25. 8
      python/google/protobuf/pyext/map_container.h
  26. 26
      python/google/protobuf/pyext/message.cc
  27. 6
      python/google/protobuf/pyext/message.h
  28. 8
      python/google/protobuf/pyext/message_factory.cc
  29. 8
      python/google/protobuf/pyext/message_factory.h
  30. 10
      python/google/protobuf/pyext/message_module.cc
  31. 12
      python/google/protobuf/pyext/repeated_composite_container.cc
  32. 8
      python/google/protobuf/pyext/repeated_composite_container.h
  33. 10
      python/google/protobuf/pyext/repeated_scalar_container.cc
  34. 8
      python/google/protobuf/pyext/repeated_scalar_container.h
  35. 6
      python/google/protobuf/pyext/safe_numerics.h
  36. 6
      python/google/protobuf/pyext/scoped_pyobject_ptr.h
  37. 6
      python/google/protobuf/pyext/unknown_field_set.cc
  38. 8
      python/google/protobuf/pyext/unknown_field_set.h
  39. 6
      python/google/protobuf/pyext/unknown_fields.cc
  40. 8
      python/google/protobuf/pyext/unknown_fields.h
  41. 6
      python/google/protobuf/python_protobuf.h

@ -102,6 +102,7 @@ if _implementation_type == 'cpp':
try:
# pylint: disable=g-import-not-at-top
from google.protobuf.pyext import _message
sys.modules['google.protobuf.internal.cpp._message'] = _message
_c_module = _message
del _message
except ImportError:
@ -151,6 +152,12 @@ def Type():
return _implementation_type
def _SetType(implementation_type):
"""Never use! Only for protobuf benchmark."""
global _implementation_type
_implementation_type = implementation_type
# See comment on 'Type' above.
# TODO(jieluo): Remove the API, it returns a constant. b/228102101
def Version():

@ -30,7 +30,7 @@
// Author: qrczak@google.com (Marcin Kowalczyk)
#include "google/protobuf/python/python_protobuf.h"
#include "third_party/py/google/protobuf/python_protobuf.h"
namespace google {
namespace protobuf {

@ -49,12 +49,11 @@ except NameError:
long = int # Python 3
# Tests whether the given TestAllTypes message is
# protobuf_unittest.TestAllTypes or not.
# Tests whether the given TestAllTypes message is proto2 or not.
# This is used to gate several fields/features that only exist
# for the protobuf_unittest version of the message.
# for the proto2 version of the message.
def IsProto2(message):
return message.DESCRIPTOR.full_name == 'protobuf_unittest.TestAllTypes'
return message.DESCRIPTOR.syntax == "proto2"
def SetAllNonLazyFields(message):

@ -42,8 +42,8 @@
// Then use the methods of the returned class:
// py_proto_api->GetMessagePointer(...);
#ifndef GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#define GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -141,4 +141,4 @@ inline const char* PyProtoAPICapsuleName() {
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PROTO_API_H__

@ -30,7 +30,7 @@
// Author: petar@google.com (Petar Petrov)
#include "google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -42,11 +42,11 @@
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/pyext/descriptor_containers.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor_containers.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h"

@ -30,8 +30,8 @@
// Author: petar@google.com (Petar Petrov)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -102,4 +102,4 @@ bool InitDescriptor();
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_H__

@ -56,13 +56,13 @@
#include <string>
#include "google/protobuf/pyext/descriptor_containers.h"
#include "third_party/py/google/protobuf/pyext/descriptor_containers.h"
// clang-format on
#include "google/protobuf/descriptor.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
// Mappings and Sequences of descriptors.
// They implement containers like fields_by_name, EnumDescriptor.values...
@ -107,4 +107,4 @@ PyObject* NewServiceMethodsByName(const ServiceDescriptor* descriptor);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_CONTAINERS_H__

@ -31,7 +31,7 @@
// This file defines a C++ DescriptorDatabase, which wraps a Python Database
// and delegate all its operations to Python methods.
#include "google/protobuf/pyext/descriptor_database.h"
#include "third_party/py/google/protobuf/pyext/descriptor_database.h"
#include <cstdint>
#include <string>
@ -40,8 +40,8 @@
#include "google/protobuf/stubs/logging.h"
#include "google/protobuf/stubs/common.h"
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -83,4 +83,4 @@ class PyDescriptorDatabase : public DescriptorDatabase {
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_DATABASE_H__

@ -39,13 +39,14 @@
#include <Python.h>
#include "google/protobuf/descriptor.pb.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_database.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_database.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#include "absl/strings/str_replace.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob) \

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -146,4 +146,4 @@ bool InitDescriptorPool();
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_DESCRIPTOR_POOL_H__

@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#include "google/protobuf/pyext/extension_dict.h"
#include "third_party/py/google/protobuf/pyext/extension_dict.h"
#include <cstdint>
#include <memory>
@ -43,12 +43,12 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/repeated_composite_container.h"
#include "google/protobuf/pyext/repeated_scalar_container.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "absl/strings/string_view.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \

@ -31,13 +31,13 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -67,4 +67,4 @@ ExtensionDict* NewExtensionDict(CMessage *parent);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_EXTENSION_DICT_H__

@ -28,11 +28,11 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/pyext/field.h"
#include "third_party/py/google/protobuf/pyext/field.h"
#include "google/protobuf/descriptor.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -57,4 +57,4 @@ PyObject* NewFieldProperty(const FieldDescriptor* field_descriptor);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_FIELD_H__

@ -30,7 +30,7 @@
// Author: haberman@google.com (Josh Haberman)
#include "google/protobuf/pyext/map_container.h"
#include "third_party/py/google/protobuf/pyext/map_container.h"
#include <cstdint>
#include <memory>
@ -41,10 +41,10 @@
#include "google/protobuf/map.h"
#include "google/protobuf/map_field.h"
#include "google/protobuf/message.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/repeated_composite_container.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -38,7 +38,7 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/message.h"
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -86,4 +86,4 @@ extern MessageMapContainer* NewMessageMapContainer(
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MAP_CONTAINER_H__

@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include <structmember.h> // A Python header file.
@ -57,18 +57,18 @@
#include "google/protobuf/message.h"
#include "google/protobuf/text_format.h"
#include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/extension_dict.h"
#include "google/protobuf/pyext/field.h"
#include "google/protobuf/pyext/map_container.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/repeated_composite_container.h"
#include "google/protobuf/pyext/repeated_scalar_container.h"
#include "google/protobuf/pyext/safe_numerics.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "google/protobuf/pyext/unknown_field_set.h"
#include "google/protobuf/pyext/unknown_fields.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/extension_dict.h"
#include "third_party/py/google/protobuf/pyext/field.h"
#include "third_party/py/google/protobuf/pyext/map_container.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
#include "third_party/py/google/protobuf/pyext/safe_numerics.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/unknown_field_set.h"
#include "third_party/py/google/protobuf/pyext/unknown_fields.h"
#include "google/protobuf/util/message_differencer.h"
#include "absl/strings/string_view.h"
#include "google/protobuf/io/coded_stream.h"

@ -31,8 +31,8 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -374,4 +374,4 @@ extern template bool CheckAndGetInteger<uint64>(PyObject*, uint64*);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_H__

@ -35,10 +35,10 @@
#include <Python.h>
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob) \

@ -28,15 +28,15 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include <unordered_map>
#include "google/protobuf/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
namespace google {
namespace protobuf {
@ -101,4 +101,4 @@ bool InitMessageFactory();
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_MESSAGE_FACTORY_H__

@ -32,11 +32,11 @@
#include <Python.h>
#include "google/protobuf/message_lite.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/proto_api.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/proto_api.h"
namespace {

@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#include "google/protobuf/pyext/repeated_composite_container.h"
#include "third_party/py/google/protobuf/pyext/repeated_composite_container.h"
#include <memory>
@ -41,11 +41,11 @@
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
#include "google/protobuf/reflection.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/message_factory.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message_factory.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
namespace google {
namespace protobuf {

@ -31,13 +31,13 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -106,4 +106,4 @@ int AssignSubscript(RepeatedCompositeContainer* self,
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_COMPOSITE_CONTAINER_H__

@ -31,7 +31,7 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#include "google/protobuf/pyext/repeated_scalar_container.h"
#include "third_party/py/google/protobuf/pyext/repeated_scalar_container.h"
#include <cstdint>
#include <memory>
@ -42,10 +42,10 @@
#include "google/protobuf/descriptor.h"
#include "google/protobuf/dynamic_message.h"
#include "google/protobuf/message.h"
#include "google/protobuf/pyext/descriptor.h"
#include "google/protobuf/pyext/descriptor_pool.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/descriptor.h"
#include "third_party/py/google/protobuf/pyext/descriptor_pool.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#define PyString_AsString(ob) \
(PyUnicode_Check(ob) ? PyUnicode_AsUTF8(ob) : PyBytes_AsString(ob))

@ -31,14 +31,14 @@
// Author: anuraag@google.com (Anuraag Agrawal)
// Author: tibell@google.com (Johan Tibell)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
#include "google/protobuf/descriptor.h"
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -73,4 +73,4 @@ PyObject* Extend(RepeatedScalarContainer* self, PyObject* value);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_REPEATED_SCALAR_CONTAINER_H__

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
// Copied from chromium with only changes to the namespace.
#include <limits>
@ -161,4 +161,4 @@ inline Dest checked_numeric_cast(Source source) {
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SAFE_NUMERICS_H__

@ -30,8 +30,8 @@
// Author: tibell@google.com (Johan Tibell)
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -96,4 +96,4 @@ typedef ScopedPythonPtr<PyObject> ScopedPyObjectPtr;
} // namespace python
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_SCOPED_PYOBJECT_PTR_H__

@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/pyext/unknown_field_set.h"
#include "third_party/py/google/protobuf/pyext/unknown_field_set.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -38,8 +38,8 @@
#include "google/protobuf/message.h"
#include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "google/protobuf/wire_format_lite.h"
namespace google {

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -37,7 +37,7 @@
#include <memory>
#include <set>
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -75,4 +75,4 @@ extern PyTypeObject PyUnknownField_Type;
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELD_SET_H__

@ -28,7 +28,7 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "google/protobuf/pyext/unknown_fields.h"
#include "third_party/py/google/protobuf/pyext/unknown_fields.h"
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -38,8 +38,8 @@
#include "google/protobuf/message.h"
#include "google/protobuf/unknown_field_set.h"
#include "google/protobuf/pyext/message.h"
#include "google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "third_party/py/google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/scoped_pyobject_ptr.h"
#include "google/protobuf/wire_format_lite.h"
namespace google {

@ -28,8 +28,8 @@
// (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
// OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#ifndef GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#define GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -37,7 +37,7 @@
#include <memory>
#include <set>
#include "google/protobuf/pyext/message.h"
#include "third_party/py/google/protobuf/pyext/message.h"
namespace google {
namespace protobuf {
@ -88,4 +88,4 @@ void Clear(PyUnknownFields* self);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_CPP_UNKNOWN_FIELDS_H__

@ -33,8 +33,8 @@
// This module exposes the C proto inside the given Python proto, in
// case the Python proto is implemented with a C proto.
#ifndef GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#define GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#ifndef THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#define THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#define PY_SSIZE_T_CLEAN
#include <Python.h>
@ -55,4 +55,4 @@ Message* MutableCProtoInsidePyProto(PyObject* msg);
} // namespace protobuf
} // namespace google
#endif // GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__
#endif // THIRD_PARTY_PY_GOOGLE_PROTOBUF_PYTHON_PYTHON_PROTOBUF_H__

Loading…
Cancel
Save