In perl.git, the branch blead has been updated <http://perl5.git.perl.org/perl.git/commitdiff/d1e7b5aaf871f3bb4562cefa3ee3153d9aa9506f?hp=877b982928bd23c44e063a6506419b9c5e214b15>
- Log ----------------------------------------------------------------- commit d1e7b5aaf871f3bb4562cefa3ee3153d9aa9506f Author: Sergey Aleynikov <[email protected]> Date: Wed Oct 5 18:29:34 2016 +0300 [RT #129789] Time::HiRes: fix compilation on darwin Commit 1c5665476f0d7250c7d93f82eab2b7cda1e6937f added explicit cast for one of the clock_gettime() arguments, but darwin lacks clockid_t, so update emulation layer to match function prototype too. ----------------------------------------------------------------------- Summary of changes: dist/Time-HiRes/HiRes.xs | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs index 1b9ee23..de63b93 100644 --- a/dist/Time-HiRes/HiRes.xs +++ b/dist/Time-HiRes/HiRes.xs @@ -802,8 +802,10 @@ static int darwin_time_init() { return success; } +typedef int clockid_t; /* to conform with POSIX prototypes */ + #ifdef TIME_HIRES_CLOCK_GETTIME_EMULATION -static int clock_gettime(int clock_id, struct timespec *ts) { +static int clock_gettime(clockid_t clock_id, struct timespec *ts) { if (darwin_time_init() && timebase_info.denom) { switch (clock_id) { case CLOCK_REALTIME: @@ -837,7 +839,7 @@ static int clock_gettime(int clock_id, struct timespec *ts) { #endif /* TIME_HIRES_CLOCK_GETTIME_EMULATION */ #ifdef TIME_HIRES_CLOCK_GETRES_EMULATION -static int clock_getres(int clock_id, struct timespec *ts) { +static int clock_getres(clockid_t clock_id, struct timespec *ts) { if (darwin_time_init() && timebase_info.denom) { switch (clock_id) { case CLOCK_REALTIME: @@ -859,7 +861,7 @@ static int clock_getres(int clock_id, struct timespec *ts) { #endif /* TIME_HIRES_CLOCK_GETRES_EMULATION */ #ifdef TIME_HIRES_CLOCK_NANOSLEEP_EMULATION -static int clock_nanosleep(int clock_id, int flags, +static int clock_nanosleep(clockid_t clock_id, int flags, const struct timespec *rqtp, struct timespec *rmtp) { if (darwin_time_init()) { -- Perl5 Master Repository
