[pypy-svn] r61353 - pypy/trunk/pypy/module/rctime

afa at codespeak.net afa at codespeak.net
Mon Jan 26 14:41:27 CET 2009


Author: afa
Date: Mon Jan 26 14:41:25 2009
New Revision: 61353

Modified:
   pypy/trunk/pypy/module/rctime/interp_time.py
Log:
Adapt the rctime module to recten MSVC compilers, which use a 64bit time_t by default;
the functions are also named differently.

Of course the C headers contain #defines to hide this change,
but ctypes can't use them of course.

Most tests in module/rctime now pass


Modified: pypy/trunk/pypy/module/rctime/interp_time.py
==============================================================================
--- pypy/trunk/pypy/module/rctime/interp_time.py	(original)
+++ pypy/trunk/pypy/module/rctime/interp_time.py	Mon Jan 26 14:41:25 2009
@@ -51,6 +51,12 @@
 cConfig.tm.__name__ = "_tm"
 
 def external(name, args, result):
+    if _WIN and rffi.sizeof(rffi.TIME_T) == 8:
+        # Recent Microsoft compilers use 64bit time_t and
+        # the corresponding functions are named differently
+        if (rffi.TIME_T in args or rffi.TIME_TP in args
+            or result in (rffi.TIME_T, rffi.TIME_TP)):
+            name = '_' + name + '64'
     return rffi.llexternal(name, args, result,
                            compilation_info=CConfig._compilation_info_,
                            calling_conv=calling_conv,



More information about the Pypy-commit mailing list