[pypy-commit] pypy default: trying to fix fron thread/thread_nt split

mattip noreply at buildbot.pypy.org
Tue Jan 29 22:37:43 CET 2013


Author: mattip
Branch: 
Changeset: r60697:d6b59575b135
Date: 2013-01-29 23:37 +0100
http://bitbucket.org/pypy/pypy/changeset/d6b59575b135/

Log:	trying to fix fron thread/thread_nt split

diff --git a/pypy/module/cpyext/api.py b/pypy/module/cpyext/api.py
--- a/pypy/module/cpyext/api.py
+++ b/pypy/module/cpyext/api.py
@@ -731,7 +731,11 @@
             global_objects.append('%s %s = NULL;' % (typ, name))
     global_code = '\n'.join(global_objects)
 
-    prologue = ("#include <Python.h>\n"
+    if sys.platform == "win32":
+        prologue = ("#include <Python.h>\n"
+                "#include <src/thread_nt.c>\n")
+    else:
+        prologue = ("#include <Python.h>\n"
                 "#include <src/thread.c>\n")
     code = (prologue +
             struct_declaration_code +
@@ -922,8 +926,8 @@
             kwds["link_extra"] = ["msvcrt.lib"]
         elif sys.platform.startswith('linux'):
             compile_extra.append("-Werror=implicit-function-declaration")
+            compile_extra.append('-g')
         export_symbols_eci.append('pypyAPI')
-        compile_extra.append('-g')
     else:
         kwds["includes"] = ['Python.h'] # this is our Python.h
 
diff --git a/rpython/translator/c/src/thread_nt.c b/rpython/translator/c/src/thread_nt.c
--- a/rpython/translator/c/src/thread_nt.c
+++ b/rpython/translator/c/src/thread_nt.c
@@ -13,6 +13,7 @@
 /*
  * Thread support.
  */
+#include "thread.h"
 
 typedef struct RPyOpaque_ThreadLock NRMUTEX, *PNRMUTEX;
 
diff --git a/rpython/translator/c/src/thread_nt.h b/rpython/translator/c/src/thread_nt.h
--- a/rpython/translator/c/src/thread_nt.h
+++ b/rpython/translator/c/src/thread_nt.h
@@ -9,6 +9,7 @@
 } NRMUTEX, *PNRMUTEX;
 
 /* prototypes */
+long RPyThreadGetIdent(void);
 long RPyThreadStart(void (*func)(void));
 int RPyThreadLockInit(struct RPyOpaque_ThreadLock *lock);
 void RPyOpaqueDealloc_ThreadLock(struct RPyOpaque_ThreadLock *lock);


More information about the pypy-commit mailing list