MSVCRT_CLOCKS_PER_SEC
Uwe Bonnes
bon at elektron.ikp.physik.tu-darmstadt.de
Wed Sep 8 03:17:13 CDT 2004
Changelog:
dlls/msvcrt/time.c: MSVCRT_clock
Use MSVCRT_CLOCKS_PER_SEC and add a test
--
Uwe Bonnes bon at elektron.ikp.physik.tu-darmstadt.de
Institut fuer Kernphysik Schlossgartenstrasse 9 64289 Darmstadt
--------- Tel. 06151 162516 -------- Fax. 06151 164321 ----------
Index: wine/dlls/msvcrt/msvcrt.h
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/msvcrt.h,v
retrieving revision 1.28
diff -u -w -r1.28 msvcrt.h
--- wine/dlls/msvcrt/msvcrt.h 3 Sep 2004 01:05:30 -0000 1.28
+++ wine/dlls/msvcrt/msvcrt.h 8 Sep 2004 08:14:21 -0000
@@ -543,6 +543,9 @@
#define MSVCRT__PC_53 0x00010000
#define MSVCRT__PC_64 0x00000000
+/* Most Unix systems defien CLOCKS_PER_SEC to 1000000 while Win32 uses 1000*/
+#define MSVCRT_CLOCKS_PER_SEC 1000
+
void MSVCRT_free(void*);
void* MSVCRT_malloc(MSVCRT_size_t);
void* MSVCRT_calloc(MSVCRT_size_t,MSVCRT_size_t);
Index: wine/dlls/msvcrt/time.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/time.c,v
retrieving revision 1.15
diff -u -w -r1.15 time.c
--- wine/dlls/msvcrt/time.c 25 Jun 2004 01:19:15 -0000 1.15
+++ wine/dlls/msvcrt/time.c 8 Sep 2004 08:14:21 -0000
@@ -203,7 +203,7 @@
ktime = ((ULONGLONG)ftk.dwHighDateTime << 32) | ftk.dwLowDateTime;
utime = ((ULONGLONG)ftu.dwHighDateTime << 32) | ftu.dwLowDateTime;
- clock = ((utime + ktime) / TICKSPERSEC) * CLOCKS_PER_SEC;
+ clock = (utime + ktime) / (TICKSPERSEC / MSVCRT_CLOCKS_PER_SEC);
return clock;
}
Index: wine/dlls/msvcrt/tests/headers.c
===================================================================
RCS file: /home/wine/wine/dlls/msvcrt/tests/headers.c,v
retrieving revision 1.4
diff -u -w -r1.4 headers.c
--- wine/dlls/msvcrt/tests/headers.c 11 Aug 2004 19:36:17 -0000 1.4
+++ wine/dlls/msvcrt/tests/headers.c 8 Sep 2004 08:14:21 -0000
@@ -358,6 +358,7 @@
CHECK_DEF("LC_TIME", LC_TIME, MSVCRT_LC_TIME);
CHECK_DEF("LC_MIN", LC_MIN, MSVCRT_LC_MIN);
CHECK_DEF("LC_MAX", LC_MAX, MSVCRT_LC_MAX);
+ CHECK_DEF("CLOCKS_PER_SEC", CLOCKS_PER_SEC, MSVCRT_CLOCKS_PER_SEC);
CHECK_DEF("_HEAPEMPTY", _HEAPEMPTY, MSVCRT__HEAPEMPTY);
CHECK_DEF("_HEAPOK", _HEAPOK, MSVCRT__HEAPOK);
CHECK_DEF("_HEAPBADBEGIN", _HEAPBADBEGIN, MSVCRT__HEAPBADBEGIN);
More information about the wine-patches
mailing list