[commit: ghc] master: Fix GetTime.c on Darwin with clock_gettime (b7b130c)
git at git.haskell.org
git at git.haskell.org
Tue Jul 5 20:09:01 UTC 2016
Repository : ssh://git@git.haskell.org/ghc
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/b7b130c5102948b38aaba723044288e16a80d492/ghc
>---------------------------------------------------------------
commit b7b130c5102948b38aaba723044288e16a80d492
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.
>---------------------------------------------------------------
b7b130c5102948b38aaba723044288e16a80d492
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 130d3f1..4d25795 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