Commit 5a31a3d8 authored by Stefan Behnel's avatar Stefan Behnel

fix public C-APIs: was missing macro definition of __Pyx_PyIdentifier_FromString()

parent e2512eae
...@@ -236,6 +236,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode): ...@@ -236,6 +236,7 @@ class ModuleNode(Nodes.Node, Nodes.BlockNode):
cname = env.mangle(Naming.varptr_prefix, entry.name) cname = env.mangle(Naming.varptr_prefix, entry.name)
h_code.putln("static %s = 0;" % type.declaration_code(cname)) h_code.putln("static %s = 0;" % type.declaration_code(cname))
h_code.putln("#define %s (*%s)" % (entry.name, cname)) h_code.putln("#define %s (*%s)" % (entry.name, cname))
h_code.put(UtilityCode.load_cached("PyIdentifierFromString", "ModuleSetupCode.c").proto)
h_code.put(import_module_utility_code.impl) h_code.put(import_module_utility_code.impl)
if api_vars: if api_vars:
h_code.put(voidptr_import_utility_code.impl) h_code.put(voidptr_import_utility_code.impl)
...@@ -2374,7 +2375,8 @@ bad: ...@@ -2374,7 +2375,8 @@ bad:
return 0; return 0;
} }
#endif #endif
""") """,
requires=[UtilityCode.load_cached("PyIdentifierFromString", "ModuleSetupCode.c")])
#------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------
...@@ -2435,7 +2437,8 @@ bad: ...@@ -2435,7 +2437,8 @@ bad:
return NULL; return NULL;
} }
#endif #endif
""") """,
requires=[UtilityCode.load_cached("PyIdentifierFromString", "ModuleSetupCode.c")])
#------------------------------------------------------------------------------------ #------------------------------------------------------------------------------------
......
...@@ -83,12 +83,10 @@ ...@@ -83,12 +83,10 @@
#if PY_MAJOR_VERSION < 3 #if PY_MAJOR_VERSION < 3
#define __Pyx_BUILTIN_MODULE_NAME "__builtin__" #define __Pyx_BUILTIN_MODULE_NAME "__builtin__"
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) PyCode_New(a, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#else #else
#define __Pyx_BUILTIN_MODULE_NAME "builtins" #define __Pyx_BUILTIN_MODULE_NAME "builtins"
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \ #define __Pyx_PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) \
PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos) PyCode_New(a, k, l, s, f, code, c, n, v, fv, cell, fn, name, fline, lnos)
#endif #endif
...@@ -369,3 +367,14 @@ static int __Pyx_check_binary_version(void) { ...@@ -369,3 +367,14 @@ static int __Pyx_check_binary_version(void) {
} }
return 0; return 0;
} }
/////////////// PyIdentifierFromString.proto ///////////////
#if !defined(__Pyx_PyIdentifier_FromString)
#if PY_MAJOR_VERSION < 3
#define __Pyx_PyIdentifier_FromString(s) PyString_FromString(s)
#else
#define __Pyx_PyIdentifier_FromString(s) PyUnicode_FromString(s)
#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