[pypy-commit] pypy ec-keepalive: Can't use this way of declaring structures with MSVC

arigo pypy.commits at gmail.com
Mon Jan 4 05:49:38 EST 2016


Author: Armin Rigo <arigo at tunes.org>
Branch: ec-keepalive
Changeset: r81541:b0933017bcbc
Date: 2016-01-04 11:48 +0100
http://bitbucket.org/pypy/pypy/changeset/b0933017bcbc/

Log:	Can't use this way of declaring structures with MSVC

diff --git a/rpython/translator/c/genc.py b/rpython/translator/c/genc.py
--- a/rpython/translator/c/genc.py
+++ b/rpython/translator/c/genc.py
@@ -734,6 +734,8 @@
     print >> f, '\tint ready;'
     print >> f, '\tchar *stack_end;'
     print >> f, '\tstruct pypy_threadlocal_s *prev, *next;'
+    # note: if the four fixed fields above are changed, you need
+    # to adapt threadlocal.c's linkedlist_head declaration too
     for field in fields:
         typename = database.gettype(field.FIELDTYPE)
         print >> f, '\t%s;' % cdecl(typename, field.fieldname)
diff --git a/rpython/translator/c/src/threadlocal.c b/rpython/translator/c/src/threadlocal.c
--- a/rpython/translator/c/src/threadlocal.c
+++ b/rpython/translator/c/src/threadlocal.c
@@ -13,8 +13,10 @@
 ;
 
 static struct pypy_threadlocal_s linkedlist_head = {
-    .prev = &linkedlist_head,
-    .next = &linkedlist_head };
+    -1,                     /* ready     */
+    NULL,                   /* stack_end */
+    &linkedlist_head,       /* prev      */
+    &linkedlist_head };     /* next      */
 
 struct pypy_threadlocal_s *
 _RPython_ThreadLocals_Enum(struct pypy_threadlocal_s *prev)


More information about the pypy-commit mailing list