Opened 4 years ago

Closed 4 years ago

#11733 closed bug (fixed)

Undeclared identifier 'CLOCK_PROCESS_CPUTIME_ID' on OS X

Reported by: erikd Owned by:
Priority: normal Milestone:
Component: Compiler Version: 8.1
Keywords: Cc: bgamari
Operating System: MacOS X Architecture: Unknown/Multiple
Type of failure: Building GHC failed Test Case:
Blocked By: Blocking:
Related Tickets: Differential Rev(s):
Wiki Page:

Description

It seems cb3456d82eaa8cea6b3 breaks OSX:

ClockGetTime.hsc:24:16: error: use of undeclared identifier 
'CLOCK_PROCESS_CPUTIME_ID'
..../inplace/lib/template-hsc.h:36:41: note: expanded from macro 'hsc_const'
        hsc_printf ("%lld", (long long)(x));

Probably also a problem on *BSD.

Change History (3)

comment:2 Changed 4 years ago by Ben Gamari <ben@…>

In 2ddfb75/ghc:

base: Fix ClockGetTime on OS X

Apparently _POSIX_CPUTIME may be defined as -1 if
CLOCK_PROCESS_CPUTIME_ID isn't defined.

Test Plan: Validate

Reviewers: austin, hvr, erikd, goldfire

Reviewed By: erikd, goldfire

Subscribers: thomie

Differential Revision: https://phabricator.haskell.org/D2028

GHC Trac Issues: #11733

comment:3 Changed 4 years ago by erikd

Resolution: fixed
Status: newclosed

This has been fixed and is currently not applicable to the ghc-8.0 branch as the problem it fixes is not yet on the ghc-8.0 branch.

Note: See TracTickets for help on using tickets.