This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
Time-HiRes: explicit clockid_t cast for C++11
authorJarkko Hietaniemi <jhi@iki.fi>
Sat, 1 Oct 2016 14:30:29 +0000 (10:30 -0400)
committerJarkko Hietaniemi <jhi@iki.fi>
Sat, 1 Oct 2016 14:53:46 +0000 (10:53 -0400)
dist/Time-HiRes/Changes
dist/Time-HiRes/HiRes.pm
dist/Time-HiRes/HiRes.xs

index e21623b..c308e72 100644 (file)
@@ -1,5 +1,8 @@
 Revision history for the Perl extension Time::HiRes.
 
+1.9740_01 [2016-10-01]
+  - explicit cast to clockid_t needed for C++11 (gcc 6, clang 3.9)
+
 1.9740 [2016-09-25]
   - the ext3/ext2 filesystems do not have subsecond resolution,
     therefore skip the t/utime.t test
index a4c5002..095aba7 100644 (file)
@@ -28,7 +28,7 @@ our @EXPORT_OK = qw (usleep sleep ualarm alarm gettimeofday time tv_interval
                 stat lstat utime
                );
 
-our $VERSION = '1.9740';
+our $VERSION = '1.9740_01';
 our $XS_VERSION = $VERSION;
 $VERSION = eval $VERSION;
 
index 3a5c7a1..1b9ee23 100644 (file)
@@ -1439,7 +1439,7 @@ clock_gettime(clock_id = CLOCK_REALTIME)
 #ifdef TIME_HIRES_CLOCK_GETTIME_SYSCALL
        status = syscall(SYS_clock_gettime, clock_id, &ts);
 #else
-       status = clock_gettime(clock_id, &ts);
+       status = clock_gettime((clockid_t)clock_id, &ts);
 #endif
        RETVAL = status == 0 ? ts.tv_sec + (NV) ts.tv_nsec / NV_1E9 : -1;
 
@@ -1472,7 +1472,7 @@ clock_getres(clock_id = CLOCK_REALTIME)
 #ifdef TIME_HIRES_CLOCK_GETRES_SYSCALL
        status = syscall(SYS_clock_getres, clock_id, &ts);
 #else
-       status = clock_getres(clock_id, &ts);
+       status = clock_getres((clockid_t)clock_id, &ts);
 #endif
        RETVAL = status == 0 ? ts.tv_sec + (NV) ts.tv_nsec / NV_1E9 : -1;