Commit 0060a354 authored by Robert Bradshaw's avatar Robert Bradshaw

Merge pull request #341 from redbrain/fix-dl-import

Emit DL_IMPORT macro for python3
parents d5b259c5 b1a6a44f
...@@ -150,6 +150,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -150,6 +150,8 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
h_code.putln("#ifndef %s" % api_guard) h_code.putln("#ifndef %s" % api_guard)
h_code.putln("") h_code.putln("")
self.generate_extern_c_macro_definition(h_code) self.generate_extern_c_macro_definition(h_code)
h_code.putln("")
self.generate_dl_import_macro(h_code)
if h_extension_types: if h_extension_types:
h_code.putln("") h_code.putln("")
for entry in h_extension_types: for entry in h_extension_types:
...@@ -671,6 +673,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -671,6 +673,11 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
code.putln(" #endif") code.putln(" #endif")
code.putln("#endif") code.putln("#endif")
def generate_dl_import_macro(self, code):
code.putln("#ifndef DL_IMPORT")
code.putln(" #define DL_IMPORT(_T) _T")
code.putln("#endif")
def generate_includes(self, env, cimported_modules, code): def generate_includes(self, env, cimported_modules, code):
includes = [] includes = []
for filename in env.include_files: for filename in env.include_files:
......
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