Author: Armin Rigo <[email protected]>
Branch: fast-gil
Changeset: r69827:3462974498df
Date: 2014-03-09 13:24 +0100
http://bitbucket.org/pypy/pypy/changeset/3462974498df/

Log:    Fix: seems that thread.c is also compiled early when running
        "rpython".

diff --git a/rpython/rlib/rthread.py b/rpython/rlib/rthread.py
--- a/rpython/rlib/rthread.py
+++ b/rpython/rlib/rthread.py
@@ -99,7 +99,7 @@
 @specialize.memo()
 def _fetch_fastgil(rpy_fastgil_value):
     eci = ExternalCompilationInfo(
-        pre_include_bits = ['#define RPY_FASTGIL %d' % rpy_fastgil_value])
+        compile_extra = ['-DRPY_FASTGIL=%d' % rpy_fastgil_value])
     return rffi.llexternal('RPyFetchFastGil', [], lltype.Signed,
                            compilation_info=eci, sandboxsafe=True)
 
diff --git a/rpython/translator/c/src/thread.c 
b/rpython/translator/c/src/thread.c
--- a/rpython/translator/c/src/thread.c
+++ b/rpython/translator/c/src/thread.c
@@ -1,17 +1,19 @@
 /* Thread implementation */
 #include "src/thread.h"
 
+#ifdef PYPY_USING_BOEHM_GC
 /* The following include is required by the Boehm GC, which apparently
  * crashes when pthread_create_thread() is not redefined to call a
  * Boehm wrapper function instead.  Ugly.
- *
- * It is also needed to see the definition of RPY_FASTGIL, if there is one.
  */
 #include "common_header.h"
+#endif
+
 
 /* More ugliness follows... */
 #ifdef RPY_FASTGIL
 # if RPY_FASTGIL == 42    /* special value to mean "asmgcc" */
+#  include "common_header.h"
 #  include "structdef.h"
 #  include "forwarddecl.h"
 # endif
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to