summaryrefslogtreecommitdiff
path: root/package/tcl/patches/patch-unix_tclUnixTime_c
blob: e0334126fff3b27f2e2d065373fc61e747e918c7 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
--- tcl8.5.8.orig/unix/tclUnixTime.c	2008-04-14 19:49:59.000000000 +0200
+++ tcl8.5.8/unix/tclUnixTime.c	2011-01-13 15:59:00.000000000 +0100
@@ -164,12 +164,6 @@ TclpGetWideClicks(void)
 
 	(*tclGetTimeProcPtr) (&time, tclTimeClientData);
 	now = (Tcl_WideInt) (time.sec*1000000 + time.usec);
-    } else {
-#ifdef MAC_OSX_TCL
-	now = (Tcl_WideInt) (mach_absolute_time() & INT64_MAX);
-#else
-#error Wide high-resolution clicks not implemented on this platform
-#endif
     }
 
     return now;
@@ -200,23 +194,6 @@ TclpWideClicksToNanoseconds(
 
     if (tclGetTimeProcPtr != NativeGetTime) {
 	nsec = clicks * 1000;
-    } else {
-#ifdef MAC_OSX_TCL
-	static mach_timebase_info_data_t tb;
-	static uint64_t maxClicksForUInt64;
-	
-	if (!tb.denom) {
-	    mach_timebase_info(&tb);
-	    maxClicksForUInt64 = UINT64_MAX / tb.numer;
-	}
-	if ((uint64_t) clicks < maxClicksForUInt64) {
-	    nsec = ((uint64_t) clicks) * tb.numer / tb.denom;
-	} else {
-	    nsec = ((long double) (uint64_t) clicks) * tb.numer / tb.denom;
-	}
-#else
-#error Wide high-resolution clicks not implemented on this platform
-#endif
     }
 
     return nsec;