[BACK]Return to patch-python_google_protobuf_pyext_message.cc CVS log [TXT][DIR] Up to [cvs.NetBSD.org] / pkgsrc / devel / protobuf / patches

File: [cvs.NetBSD.org] / pkgsrc / devel / protobuf / patches / Attic / patch-python_google_protobuf_pyext_message.cc (download)

Revision 1.1, Sun Jan 6 11:21:06 2019 UTC (20 months, 2 weeks ago) by markd
Branch: MAIN

{py-,}protobuf: update to 3.6.1

minor changes.
patches for python3.7
build py-protobuf with "--cpp_implementation" to get _message extension

$NetBSD: patch-python_google_protobuf_pyext_message.cc,v 1.1 2019/01/06 11:21:06 markd Exp $

--- python/google/protobuf/pyext/message.cc.orig	2018-07-30 22:16:10.000000000 +0000
+++ python/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, PyObj
     return NULL;
   }
 #else
-  field_name = PyUnicode_AsUTF8AndSize(arg, &size);
+  field_name = const_cast<char*>(PyUnicode_AsUTF8AndSize(arg, &size));
   if (!field_name) {
     return NULL;
   }