Author: mattip <[email protected]>
Branch: vmprof2
Changeset: r76893:9591d90505b9
Date: 2015-04-23 00:38 +0300
http://bitbucket.org/pypy/pypy/changeset/9591d90505b9/

Log:    try a fix for msvc on win32

diff --git a/rpython/jit/backend/llsupport/codemap.py 
b/rpython/jit/backend/llsupport/codemap.py
--- a/rpython/jit/backend/llsupport/codemap.py
+++ b/rpython/jit/backend/llsupport/codemap.py
@@ -26,7 +26,16 @@
 srcdir = os.path.join(os.path.dirname(__file__), 'src')
 
 eci = ExternalCompilationInfo(post_include_bits=["""
+#if defined _MSC_VER && _MSC_VER < 1600
+#ifdef _WIN32
+typedef unsigned int uintptr_t;
+#else
+typedef usigned long uintptr_t;
+#endif
+#else
 #include <stdint.h>
+#endif
+
 RPY_EXTERN long pypy_jit_codemap_add(uintptr_t addr,
                                      unsigned int machine_code_size,
                                      long *bytecode_info,
diff --git a/rpython/jit/backend/llsupport/src/skiplist.c 
b/rpython/jit/backend/llsupport/src/skiplist.c
--- a/rpython/jit/backend/llsupport/src/skiplist.c
+++ b/rpython/jit/backend/llsupport/src/skiplist.c
@@ -1,5 +1,25 @@
 #include <stdlib.h>
+#if defined _MSC_VER
+ #if _MSC_VER < 1600
+  #include <intrin.h>
+  int __sync_lock_test_and_set(int * i, int j)
+  {
+    return _interlockedbittestandreset(i, j);
+  }
+  int __sync_lock_release(int *i)
+  {
+    return _interlockedbittestandreset(i, 0);
+  }
+  #ifdef _WIN32
+   typedef unsigned int uintptr_t;
+  #else
+   typedef usigned long uintptr_t;
+  #endif
+ #endif
+#else
 #include <stdint.h>
+#endif
+
 
 #define HAS_SKIPLIST
 #define SKIPLIST_HEIGHT   8
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to