Commit 7a6c4e2a authored by Stefan Behnel's avatar Stefan Behnel

fix compile problem with MSVC where type pointers aren't static compile time constants

parent 96cfed7b
...@@ -1275,13 +1275,17 @@ class GlobalState(object): ...@@ -1275,13 +1275,17 @@ class GlobalState(object):
if not self.cached_cmethods: if not self.cached_cmethods:
return return
w = self.parts['decls'] decl = self.parts['decls']
init = self.parts['init_globals']
cnames = [] cnames = []
for (type_cname, method_name, _), cname in sorted(self.cached_cmethods.items()): for (type_cname, method_name, _), cname in sorted(self.cached_cmethods.items()):
cnames.append(cname) cnames.append(cname)
method_name_cname = self.get_interned_identifier(StringEncoding.EncodedString(method_name)).cname method_name_cname = self.get_interned_identifier(StringEncoding.EncodedString(method_name)).cname
w.putln('static __Pyx_CachedCFunction %s = {(PyObject*)&%s, &%s, 0, 0, 0};' % ( decl.putln('static __Pyx_CachedCFunction %s = {0, &%s, 0, 0, 0};' % (
cname, type_cname, method_name_cname)) cname, method_name_cname))
# split type reference storage as it might not be static
init.putln('%s.type = (PyObject*)&%s;' % (
cname, type_cname))
if Options.generate_cleanup_code: if Options.generate_cleanup_code:
cleanup = self.parts['cleanup_globals'] cleanup = self.parts['cleanup_globals']
......
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