diff options
author | Tomasz Konojacki <me@xenu.pl> | 2019-09-23 03:19:05 +0200 |
---|---|---|
committer | Tony Cook <tony@develop-help.com> | 2019-09-23 13:41:03 +1000 |
commit | daacfc65685f1de72b332b75b34d3b57dc866b04 (patch) | |
tree | 8a56ae3b149ddc0899b0499180990624a843c146 /dist/Time-HiRes | |
parent | 3e14cc163c638e063c3e2a746616e50ecf58e23e (diff) | |
download | perl-daacfc65685f1de72b332b75b34d3b57dc866b04.tar.gz |
Time::HiRes: fix compilation with Visual C++ 2013 and older
1d96b9c90e199a42267d0142b9d623350a183412 broke it. It turns out
that Visual C++ 2013 and older don't have the timespec structure.
[perl #134447]
Diffstat (limited to 'dist/Time-HiRes')
-rw-r--r-- | dist/Time-HiRes/HiRes.xs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/dist/Time-HiRes/HiRes.xs b/dist/Time-HiRes/HiRes.xs index 8684dd4457..8002472866 100644 --- a/dist/Time-HiRes/HiRes.xs +++ b/dist/Time-HiRes/HiRes.xs @@ -139,6 +139,14 @@ typedef struct { unsigned __int64 reset_time; } my_cxt_t; +/* Visual C++ 2013 and older don't have the timespec structure */ +# if defined(_MSC_VER) && _MSC_VER < 1900 +struct timespec { + time_t tv_sec; + long tv_nsec; +}; +# endif + START_MY_CXT /* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */ |