Commit a390543f authored by Stefan Behnel's avatar Stefan Behnel

make sure utility code loaded for header files and module preamble gets properly formatted

parent fc4a97a0
......@@ -241,14 +241,14 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cname = env.mangle(Naming.varptr_prefix, entry.name)
h_code.putln("static %s = 0;" % type.declaration_code(cname))
h_code.putln("#define %s (*%s)" % (entry.name, cname))
h_code.put(UtilityCode.load_cached("PyIdentifierFromString", "ImportExport.c").proto)
h_code.put(UtilityCode.load_cached("ModuleImport", "ImportExport.c").impl)
h_code.put(UtilityCode.load_as_string("PyIdentifierFromString", "ImportExport.c")[0])
h_code.put(UtilityCode.load_as_string("ModuleImport", "ImportExport.c")[1])
if api_vars:
h_code.put(UtilityCode.load_cached("VoidPtrImport", "ImportExport.c").impl)
h_code.put(UtilityCode.load_as_string("VoidPtrImport", "ImportExport.c")[1])
if api_funcs:
h_code.put(UtilityCode.load_cached("FunctionImport", "ImportExport.c").impl)
h_code.put(UtilityCode.load_as_string("FunctionImport", "ImportExport.c")[1])
if api_extension_types:
h_code.put(UtilityCode.load_cached("TypeImport", "ImportExport.c").impl)
h_code.put(UtilityCode.load_as_string("TypeImport", "ImportExport.c")[1])
h_code.putln("")
h_code.putln("static int import_%s(void) {" % self.api_name(env))
h_code.putln("PyObject *module = 0;")
......@@ -555,8 +555,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln("#define CYTHON_CCOMPLEX 1")
code.putln("#endif")
code.putln("")
code.put(UtilityCode.load_cached("UtilityFunctionPredeclarations", "ModuleSetupCode.c").proto)
code.put(UtilityCode.load_cached("TypeConversions", "TypeConversion.c").proto)
code.put(UtilityCode.load_as_string("UtilityFunctionPredeclarations", "ModuleSetupCode.c")[0])
code.put(UtilityCode.load_as_string("TypeConversions", "TypeConversion.c")[0])
code.put(Nodes.branch_prediction_macros)
code.putln('')
code.putln('static PyObject *%s;' % env.module_cname)
......
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