pyext: missing cast to constant char* (#5713)

We need to cast to a constant charpointer here.
pull/5788/head
grindhold 6 years ago committed by Jie Luo
parent 89b914f81d
commit 3a538fc91e
  1. 8
      python/google/protobuf/pyext/message_factory.cc

@ -43,9 +43,11 @@
#error "Python 3.0 - 3.2 are not supported."
#endif
#define PyString_AsStringAndSize(ob, charpp, sizep) \
(PyUnicode_Check(ob)? \
((*(charpp) = PyUnicode_AsUTF8AndSize(ob, (sizep))) == NULL? -1: 0): \
PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
(PyUnicode_Check(ob) ? ((*(charpp) = const_cast<char*>( \
PyUnicode_AsUTF8AndSize(ob, (sizep)))) == NULL \
? -1 \
: 0) \
: PyBytes_AsStringAndSize(ob, (charpp), (sizep)))
#endif
namespace google {

Loading…
Cancel
Save