diff options
| author | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-07-08 15:24:31 +0300 |
|---|---|---|
| committer | Brad Bishop <bradleyb@fuzziesquirrel.com> | 2019-07-08 16:34:48 +0300 |
| commit | 2939317205d1f39eefebec7bd6ba01faaa0f9369 (patch) | |
| tree | 45f4ba1e0bca7dc394b7fa77ca3122f1121a6a55 /meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch | |
| parent | 963b1beb7e04e1c6c55bea2104b856e3121202db (diff) | |
| download | openbmc-2939317205d1f39eefebec7bd6ba01faaa0f9369.tar.xz | |
reset upstream subtrees to warrior HEAD2.7.0-rc1
Reset the following subtrees on warrior HEAD:
meta-security: 4f7be0d252(warrior)
poky: 38d5c8ea98(warrior)
meta-raspberrypi: 6c73694912(warrior)
meta-openembedded: 6fa72d587a(warrior)
Change-Id: Id2550baeb90de14bdd9ee8c06f2c619fc719bc68
Signed-off-by: Brad Bishop <bradleyb@fuzziesquirrel.com>
Diffstat (limited to 'meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch')
| -rw-r--r-- | meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch | 98 |
1 files changed, 98 insertions, 0 deletions
diff --git a/meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch b/meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch new file mode 100644 index 0000000000..da5e73b152 --- /dev/null +++ b/meta-openembedded/meta-python/recipes-devtools/python/python3-protobuf/0001-Add-Python-3.7-compatibility-4862.patch @@ -0,0 +1,98 @@ +From 539bc017a62f91bdf7c547b58948cb5a2f59d918 Mon Sep 17 00:00:00 2001 +From: Ben Webb <ben@salilab.org> +Date: Thu, 12 Jul 2018 10:58:10 -0700 +Subject: [PATCH] Add Python 3.7 compatibility (#4862) + +Compilation of Python wrappers fails with Python 3.7 because +the Python folks changed their C API such that +PyUnicode_AsUTF8AndSize() now returns a const char* rather +than a char*. Add a patch to work around. Relates #4086. + +Upstream-Status: Backport [https://github.com/protocolbuffers/protobuf.git] +Signed-off-by: Hongxu Jia <hongxu.jia@windriver.com> + +--- + google/protobuf/pyext/descriptor.cc | 2 +- + google/protobuf/pyext/descriptor_containers.cc | 2 +- + google/protobuf/pyext/descriptor_pool.cc | 2 +- + google/protobuf/pyext/extension_dict.cc | 2 +- + google/protobuf/pyext/message.cc | 4 ++-- + 5 files changed, 6 insertions(+), 6 deletions(-) + +diff --git a/google/protobuf/pyext/descriptor.cc b/google/protobuf/pyext/descriptor.cc +index 8af0cb1..19a1c38 100644 +--- a/google/protobuf/pyext/descriptor.cc ++++ b/google/protobuf/pyext/descriptor.cc +@@ -56,7 +56,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/google/protobuf/pyext/descriptor_containers.cc b/google/protobuf/pyext/descriptor_containers.cc +index bc007f7..0153664 100644 +--- a/google/protobuf/pyext/descriptor_containers.cc ++++ b/google/protobuf/pyext/descriptor_containers.cc +@@ -66,7 +66,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/google/protobuf/pyext/descriptor_pool.cc b/google/protobuf/pyext/descriptor_pool.cc +index 95882ae..962accc 100644 +--- a/google/protobuf/pyext/descriptor_pool.cc ++++ b/google/protobuf/pyext/descriptor_pool.cc +@@ -48,7 +48,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/google/protobuf/pyext/extension_dict.cc b/google/protobuf/pyext/extension_dict.cc +index 018b5c2..174c547 100644 +--- a/google/protobuf/pyext/extension_dict.cc ++++ b/google/protobuf/pyext/extension_dict.cc +@@ -53,7 +53,7 @@ + #endif + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + +diff --git a/google/protobuf/pyext/message.cc b/google/protobuf/pyext/message.cc +index 5893533..31094b7 100644 +--- a/google/protobuf/pyext/message.cc ++++ b/google/protobuf/pyext/message.cc +@@ -79,7 +79,7 @@ + (PyUnicode_Check(ob)? PyUnicode_AsUTF8(ob): PyBytes_AsString(ob)) + #define PyString_AsStringAndSize(ob, charpp, sizep) \ + (PyUnicode_Check(ob)? \ +- ((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \ ++ ((*(charpp) = const_cast<char*>(PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL? -1: 0): \ + PyBytes_AsStringAndSize(ob, (charpp), (sizep))) + #endif + #endif +@@ -1529,7 +1529,7 @@ PyObject* HasField(CMessage* self, PyObject* arg) { + return NULL; + } + #else +- field_name = PyUnicode_AsUTF8AndSize(arg, &size); ++ field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size)); + if (!field_name) { + return NULL; + } +-- +2.7.4 + |
