Commit 644238bd authored by Lisandro Dalcin's avatar Lisandro Dalcin

better Py -> C conversion for integral types (ticket #255)

parent 7b052e86
...@@ -565,6 +565,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -565,6 +565,12 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
env.use_utility_code(streq_utility_code) env.use_utility_code(streq_utility_code)
# XXX this is a mess
for utility_code in PyrexTypes.c_int_from_py_function.specialize_list:
env.use_utility_code(utility_code)
for utility_code in PyrexTypes.c_long_from_py_function.specialize_list:
env.use_utility_code(utility_code)
def generate_extern_c_macro_definition(self, code): def generate_extern_c_macro_definition(self, code):
name = Naming.extern_c_macro name = Naming.extern_c_macro
code.putln("#ifdef __cplusplus") code.putln("#ifdef __cplusplus")
......
This diff is collapsed.
...@@ -105,6 +105,7 @@ class UtilityCode(object): ...@@ -105,6 +105,7 @@ class UtilityCode(object):
self.cleanup = cleanup self.cleanup = cleanup
self.requires = requires self.requires = requires
self._cache = {} self._cache = {}
self.specialize_list = []
def write_init_code(self, writer, pos): def write_init_code(self, writer, pos):
if not self.init: if not self.init:
...@@ -141,4 +142,5 @@ class UtilityCode(object): ...@@ -141,4 +142,5 @@ class UtilityCode(object):
none_or_sub(self.init, data), none_or_sub(self.init, data),
none_or_sub(self.cleanup, data), none_or_sub(self.cleanup, data),
requires) requires)
self.specialize_list.append(s)
return s return s
This diff is collapsed.
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