Commit 1bb2ba41 authored by Stefan Behnel's avatar Stefan Behnel

work around 'unused function __Pyx_ImportModule()' compiler warning

parent 8f0a8bf5
......@@ -1912,12 +1912,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self.body.generate_execution_code(code)
if Options.generate_cleanup_code:
# this should be replaced by the module's tp_clear in Py3
code.globalstate.use_utility_code(
UtilityCode.load_cached("RegisterModuleCleanup", "ModuleSetupCode.c"))
code.putln("#if PY_MAJOR_VERSION < 3")
code.putln("if (__Pyx_RegisterCleanup()) %s;" % code.error_goto(self.pos))
code.putln("#endif")
code.put_goto(code.return_label)
code.put_label(code.error_label)
......
......@@ -478,8 +478,8 @@ end:
/////////////// RegisterModuleCleanup.proto ///////////////
//@substitute: naming
#if PY_MAJOR_VERSION < 3
static int __Pyx_RegisterCleanup(void); /*proto*/
#if PY_MAJOR_VERSION < 3
static PyObject* ${cleanup_cname}(PyObject *self, PyObject *unused); /*proto*/
#endif
......@@ -552,4 +552,10 @@ bad:
Py_XDECREF(res);
return ret;
}
#else
// fake call purely to work around "unused function" warning for __Pyx_ImportModule()
static int __Pyx_RegisterCleanup(void) {
if (0) __Pyx_ImportModule(NULL);
return 0;
}
#endif
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment