[pypy-commit] pypy py3k-clock_get_info: Implement dynamic lookup properly.
marky1991
pypy.commits at gmail.com
Fri May 27 21:20:03 EDT 2016
Author: Mark Young <marky1991 at gmail.com>
Branch: py3k-clock_get_info
Changeset: r84765:336db4a60686
Date: 2016-05-24 21:30 -0400
http://bitbucket.org/pypy/pypy/changeset/336db4a60686/
Log: Implement dynamic lookup properly.
diff --git a/pypy/module/time/interp_time.py b/pypy/module/time/interp_time.py
--- a/pypy/module/time/interp_time.py
+++ b/pypy/module/time/interp_time.py
@@ -111,13 +111,6 @@
self.n_overflow = 0
self.last_ticks = 0
time_state = TimeState()
- from rpython.rlib.rdynload import GetModuleHandle, dlsym
- hKernel32 = GetModuleHandle("KERNEL32")
- try:
- dlsym(hKernel32, 'GetFinalPathNameByHandleW')
- HAS_GETTICKCOUNT64 = True
- except KeyError:
- HAS_GETTICKCOUNT64 = False
_includes = ["time.h"]
if _POSIX:
@@ -733,13 +726,19 @@
if _WIN:
# untested so far
- _GetTickCount64 = rwin32.winexternal('GetTickCount64', [], rffi.ULONGLONG)
_GetTickCount = rwin32.winexternal('GetTickCount', [], rwin32.DWORD)
LPDWORD = rwin32.LPDWORD
_GetSystemTimeAdjustment = rwin32.winexternal(
'GetSystemTimeAdjustment',
[LPDWORD, LPDWORD, rwin32.LPBOOL],
rffi.INT)
+ from rpython.rlib.rdynload import GetModuleHandle, dlsym
+ hKernel32 = GetModuleHandle("KERNEL32")
+ try:
+ _GetTickCount64 = dlsym(hKernel32, 'GetTickCount64')
+ HAS_GETTICKCOUNT64 = True
+ except KeyError:
+ HAS_GETTICKCOUNT64 = False
def monotonic(space, w_info=None):
result = 0
More information about the pypy-commit
mailing list