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): ...@@ -1912,12 +1912,9 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
self.body.generate_execution_code(code) self.body.generate_execution_code(code)
if Options.generate_cleanup_code: if Options.generate_cleanup_code:
# this should be replaced by the module's tp_clear in Py3
code.globalstate.use_utility_code( code.globalstate.use_utility_code(
UtilityCode.load_cached("RegisterModuleCleanup", "ModuleSetupCode.c")) 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("if (__Pyx_RegisterCleanup()) %s;" % code.error_goto(self.pos))
code.putln("#endif")
code.put_goto(code.return_label) code.put_goto(code.return_label)
code.put_label(code.error_label) code.put_label(code.error_label)
......
...@@ -478,8 +478,8 @@ end: ...@@ -478,8 +478,8 @@ end:
/////////////// RegisterModuleCleanup.proto /////////////// /////////////// RegisterModuleCleanup.proto ///////////////
//@substitute: naming //@substitute: naming
#if PY_MAJOR_VERSION < 3
static int __Pyx_RegisterCleanup(void); /*proto*/ static int __Pyx_RegisterCleanup(void); /*proto*/
#if PY_MAJOR_VERSION < 3
static PyObject* ${cleanup_cname}(PyObject *self, PyObject *unused); /*proto*/ static PyObject* ${cleanup_cname}(PyObject *self, PyObject *unused); /*proto*/
#endif #endif
...@@ -552,4 +552,10 @@ bad: ...@@ -552,4 +552,10 @@ bad:
Py_XDECREF(res); Py_XDECREF(res);
return ret; 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 #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