Commit ea29696f authored by gsamain's avatar gsamain

Inject CyRefCount macros

parent b4c7b2e5
...@@ -418,6 +418,10 @@ def init_builtin_structs(): ...@@ -418,6 +418,10 @@ def init_builtin_structs():
builtin_scope.declare_struct_or_union( builtin_scope.declare_struct_or_union(
name, "struct", scope, 1, None, cname = cname) name, "struct", scope, 1, None, cname = cname)
def inject_cypclass_refcount_macros():
macro_type = PyrexTypes.CFuncType(PyrexTypes.c_void_type, [PyrexTypes.CFuncTypeArg("obj", PyrexTypes.cy_object_type, None)], nogil = 1)
for macro in ["Cy_INCREF", "Cy_DECREF", "Cy_XDECREF"]:
builtin_scope.declare_builtin_cfunction(macro, macro_type, macro)
def init_builtins(): def init_builtins():
init_builtin_structs() init_builtin_structs()
...@@ -446,6 +450,7 @@ def init_builtins(): ...@@ -446,6 +450,7 @@ def init_builtins():
float_type = builtin_scope.lookup('float').type float_type = builtin_scope.lookup('float').type
bool_type = builtin_scope.lookup('bool').type bool_type = builtin_scope.lookup('bool').type
complex_type = builtin_scope.lookup('complex').type complex_type = builtin_scope.lookup('complex').type
inject_cypclass_refcount_macros()
init_builtins() init_builtins()
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