Author: Matti Picus <[email protected]>
Branch: msvc14
Changeset: r93703:5664c6a12efb
Date: 2018-01-24 10:04 +0200
http://bitbucket.org/pypy/pypy/changeset/5664c6a12efb/

Log:    start to pass translator tests

diff --git a/rpython/rlib/clibffi.py b/rpython/rlib/clibffi.py
--- a/rpython/rlib/clibffi.py
+++ b/rpython/rlib/clibffi.py
@@ -296,7 +296,8 @@
     def get_libc_name():
         return rwin32.GetModuleFileName(get_libc_handle())
 
-    assert "msvcr" in get_libc_name().lower(), \
+    libc_name = get_libc_name().lower()
+    assert "msvcr" in libc_name or 'ucrtbase' in libc_name, \
            "Suspect msvcrt library: %s" % (get_libc_name(),)
 elif _MINGW:
     def get_libc_name():
diff --git a/rpython/rlib/rposix.py b/rpython/rlib/rposix.py
--- a/rpython/rlib/rposix.py
+++ b/rpython/rlib/rposix.py
@@ -43,7 +43,8 @@
     else:
         includes=['errno.h','stdio.h', 'stdint.h']
     separate_module_sources =['''
-        /* Lifted completely from CPython 3.3 Modules/posix_module.c */
+        /* Lifted completely from CPython 3 Modules/posix_module.c */
+        #if defined _MSC_VER && MSC_VER >= 1400 && _MSC_VER < 1900
         #include <malloc.h> /* for _msize */
         typedef struct {
             intptr_t osfhnd;
@@ -95,6 +96,13 @@
             errno = EBADF;
             return 0;
         }
+        #else
+        RPY_EXTERN int
+        _PyVerify_fd(int fd)
+        {
+            return 1;
+        }
+        #endif
     ''',]
     post_include_bits=['RPY_EXTERN int _PyVerify_fd(int);']
 else:
diff --git a/rpython/translator/platform/test/test_makefile.py 
b/rpython/translator/platform/test/test_makefile.py
--- a/rpython/translator/platform/test/test_makefile.py
+++ b/rpython/translator/platform/test/test_makefile.py
@@ -82,7 +82,7 @@
         eci.separate_module_files = [main_c]
         ncfiles = 10
         nprecompiled_headers = 20
-        txt = ''
+        txt = '#include <stdio.h>\n'
         for i in range(ncfiles):
             txt += "int func%03d();\n" % i
         txt += "\nint main(int argc, char * argv[])\n"
@@ -138,7 +138,7 @@
         t_precompiled = t1 - t0
         res = self.platform.execute(mk.exe_name)
         self.check_res(res, '%d\n' %sum(range(ncfiles)))
-        print "precompiled haeder 'make' time %.2f, non-precompiled header 
time %.2f" %(t_precompiled, t_normal)
-        assert t_precompiled < t_normal * 0.5
+        print "precompiled header 'make' time %.2f, non-precompiled header 
time %.2f" %(t_precompiled, t_normal)
+        assert t_precompiled < t_normal
 
    
_______________________________________________
pypy-commit mailing list
[email protected]
https://mail.python.org/mailman/listinfo/pypy-commit

Reply via email to