[pypy-svn] r31980 - pypy/dist/pypy/module/rctime

rhymes at codespeak.net rhymes at codespeak.net
Mon Sep 4 11:33:23 CEST 2006


Author: rhymes
Date: Mon Sep  4 11:33:21 2006
New Revision: 31980

Modified:
   pypy/dist/pypy/module/rctime/interp_time.py
Log:
replaced fmod from math to libc's fmod. Hope this fixes compilation issues

Modified: pypy/dist/pypy/module/rctime/interp_time.py
==============================================================================
--- pypy/dist/pypy/module/rctime/interp_time.py	(original)
+++ pypy/dist/pypy/module/rctime/interp_time.py	Mon Sep  4 11:33:21 2006
@@ -6,7 +6,6 @@
 from pypy.interpreter.baseobjspace import W_Root, ObjSpace
 from ctypes import *
 import os
-import math
 import sys
 
 _POSIX = os.name == "posix"
@@ -88,6 +87,8 @@
     Sleep.restype = None
 libc.strftime.argtypes = [c_char_p, size_t, c_char_p, POINTER(tm)]
 libc.strftime.restype = size_t
+libc.fmod.argtypes = [c_double, c_double]
+libc.fmod.restype = c_double
 
 def _init_accept2dyear():
     return (1, 0)[bool(os.getenv("PYTHONY2K"))]
@@ -265,7 +266,7 @@
 
     buf.tm_year = y - 1900
     buf.tm_mon = buf.tm_mon - 1
-    buf.tm_wday = int(math.fmod((buf.tm_wday + 1), 7))
+    buf.tm_wday = int(libc.fmod((buf.tm_wday + 1), 7))
     buf.tm_yday = buf.tm_yday - 1
 
     return buf



More information about the Pypy-commit mailing list