[commit: ghc] ghc-8.0: Fix GetTime.c on Darwin with clock_gettime (a0f1809)
git at git.haskell.org
git at git.haskell.org
Mon Jul 25 18:36:35 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : ghc-8.0
Link : http://ghc.haskell.org/trac/ghc/changeset/a0f1809742160ca0c07778f91f3e2a8ea147c0a4/ghc
>---------------------------------------------------------------
commit a0f1809742160ca0c07778f91f3e2a8ea147c0a4
Author: Misty De Meo <mistydemeo at github.com>
Date: Wed Jun 15 15:02:13 2016 -0700
Fix GetTime.c on Darwin with clock_gettime
On Darwin versions with clock_gettime, #ifdefs will prevent the
mach-specific time functions from being used in most places, and
the mach time headers won't be included; however, this section
was guarded incorrectly and would still try to use them.
Fixes #12195.
(cherry picked from commit b7b130c5102948b38aaba723044288e16a80d492)
>---------------------------------------------------------------
a0f1809742160ca0c07778f91f3e2a8ea147c0a4
rts/posix/GetTime.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/rts/posix/GetTime.c b/rts/posix/GetTime.c
index def78a4..f6182f9 100644
--- a/rts/posix/GetTime.c
+++ b/rts/posix/GetTime.c
@@ -29,14 +29,14 @@
// we'll implement getProcessCPUTime() and getProcessElapsedTime()
// separately, using getrusage() and gettimeofday() respectively
-#ifdef darwin_HOST_OS
+#if !defined(HAVE_CLOCK_GETTIME) && defined(darwin_HOST_OS)
static uint64_t timer_scaling_factor_numer = 0;
static uint64_t timer_scaling_factor_denom = 0;
#endif
void initializeTimer()
{
-#ifdef darwin_HOST_OS
+#if !defined(HAVE_CLOCK_GETTIME) && defined(darwin_HOST_OS)
mach_timebase_info_data_t info;
(void) mach_timebase_info(&info);
timer_scaling_factor_numer = (uint64_t)info.numer;
More information about the ghc-commits
mailing list