Py3: suppress warnings about un-initialized/deprecated tp_print slot
This commit is contained in:
@@ -22,8 +22,6 @@
|
||||
|
||||
|
||||
#include "PreCompiled.h"
|
||||
#include "PyExport.h"
|
||||
#include "Exception.h"
|
||||
#include <sstream>
|
||||
#if (defined(HAVE_SWIG) && (HAVE_SWIG == 1))
|
||||
#if defined(__clang__)
|
||||
@@ -37,6 +35,8 @@
|
||||
# pragma GCC diagnostic ignored "-Wcast-function-type"
|
||||
# endif
|
||||
#endif
|
||||
#include "PyExport.h"
|
||||
#include "Exception.h"
|
||||
namespace Swig_python {
|
||||
#define SWIG_PYTHON_NO_BUILD_NONE
|
||||
#include <swigpyrun.h>
|
||||
|
||||
@@ -106,11 +106,21 @@ App::DocumentObjectExecReturn* Primitive::execute(void) {
|
||||
return Part::Feature::execute();
|
||||
}
|
||||
|
||||
// suppress warning about tp_print for Py3.8
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||
#endif
|
||||
|
||||
namespace Part {
|
||||
PYTHON_TYPE_DEF(PrimitivePy, PartFeaturePy)
|
||||
PYTHON_TYPE_IMP(PrimitivePy, PartFeaturePy)
|
||||
}
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
PyObject* Primitive::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
|
||||
@@ -155,9 +155,19 @@ void FeaturePrimitive::handleChangedPropertyName(Base::XMLReader &reader, const
|
||||
extHandleChangedPropertyName(reader, TypeName, PropName); // AttachExtension
|
||||
}
|
||||
|
||||
// suppress warning about tp_print for Py3.8
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic push
|
||||
# pragma clang diagnostic ignored "-Wmissing-field-initializers"
|
||||
#endif
|
||||
|
||||
PYTHON_TYPE_DEF(PrimitivePy, PartDesign::FeaturePy)
|
||||
PYTHON_TYPE_IMP(PrimitivePy, PartDesign::FeaturePy)
|
||||
|
||||
#if defined(__clang__)
|
||||
# pragma clang diagnostic pop
|
||||
#endif
|
||||
|
||||
PyObject* FeaturePrimitive::getPyObject()
|
||||
{
|
||||
if (PythonObject.is(Py::_None())){
|
||||
|
||||
Reference in New Issue
Block a user