Python: fixing Python 3.8 build with clang.

Python 3.8 has 'tp_print' field in PyTypeObject struct.  This field is
attributed as deprecated.  So, clang generates warning (which is turned to
error) as a result of initializing this field.  From the other hand, it is
impossible to omit this field in positional initialization.  The solution
is to use designated initializer.

Silencing usage message during configure python.

This is related to #331 issue on GitHub.
This commit is contained in:
Max Romanov
2019-10-23 14:04:29 +03:00
parent 23b94fde83
commit ad518ae6c4
2 changed files with 8 additions and 54 deletions

View File

@@ -64,7 +64,7 @@ nxt_found=no
if /bin/sh -c "$NXT_PYTHON_CONFIG --prefix" >> $NXT_AUTOCONF_ERR 2>&1; then
if ${NXT_PYTHON_CONFIG} --embed 2>/dev/null; then
if ${NXT_PYTHON_CONFIG} --embed >/dev/null 2>&1; then
NXT_PYTHON_CONFIG="${NXT_PYTHON_CONFIG} --embed"
fi

View File

@@ -130,59 +130,13 @@ static PyMethodDef nxt_py_input_methods[] = {
static PyTypeObject nxt_py_input_type = {
PyVarObject_HEAD_INIT(NULL, 0)
"unit._input", /* tp_name */
(int) sizeof(nxt_py_input_t), /* tp_basicsize */
0, /* tp_itemsize */
(destructor) nxt_py_input_dealloc, /* tp_dealloc */
0, /* tp_print */
0, /* tp_getattr */
0, /* tp_setattr */
0, /* tp_compare */
0, /* tp_repr */
0, /* tp_as_number */
0, /* tp_as_sequence */
0, /* tp_as_mapping */
0, /* tp_hash */
0, /* tp_call */
0, /* tp_str */
0, /* tp_getattro */
0, /* tp_setattro */
0, /* tp_as_buffer */
Py_TPFLAGS_DEFAULT, /* tp_flags */
"unit input object.", /* tp_doc */
0, /* tp_traverse */
0, /* tp_clear */
0, /* tp_richcompare */
0, /* tp_weaklistoffset */
0, /* tp_iter */
0, /* tp_iternext */
nxt_py_input_methods, /* tp_methods */
0, /* tp_members */
0, /* tp_getset */
0, /* tp_base */
0, /* tp_dict */
0, /* tp_descr_get */
0, /* tp_descr_set */
0, /* tp_dictoffset */
0, /* tp_init */
0, /* tp_alloc */
0, /* tp_new */
0, /* tp_free */
0, /* tp_is_gc */
0, /* tp_bases */
0, /* tp_mro - method resolution order */
0, /* tp_cache */
0, /* tp_subclasses */
0, /* tp_weaklist */
0, /* tp_del */
0, /* tp_version_tag */
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION > 3
0, /* tp_finalize */
#endif
#if PY_MAJOR_VERSION == 3 && PY_MINOR_VERSION >= 8
0, /* tp_vectorcall */
0, /* tp_print */
#endif
.tp_name = "unit._input",
.tp_basicsize = sizeof(nxt_py_input_t),
.tp_dealloc = (destructor) nxt_py_input_dealloc,
.tp_flags = Py_TPFLAGS_DEFAULT,
.tp_doc = "unit input object.",
.tp_methods = nxt_py_input_methods,
};