Skip to content

Commit daacfc6

Browse files
xenutonycoz
authored andcommitted
Time::HiRes: fix compilation with Visual C++ 2013 and older
1d96b9c broke it. It turns out that Visual C++ 2013 and older don't have the timespec structure. [perl #134447]
1 parent 3e14cc1 commit daacfc6

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

dist/Time-HiRes/HiRes.xs

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,14 @@ typedef struct {
139139
unsigned __int64 reset_time;
140140
} my_cxt_t;
141141

142+
/* Visual C++ 2013 and older don't have the timespec structure */
143+
# if defined(_MSC_VER) && _MSC_VER < 1900
144+
struct timespec {
145+
time_t tv_sec;
146+
long tv_nsec;
147+
};
148+
# endif
149+
142150
START_MY_CXT
143151

144152
/* Number of 100 nanosecond units from 1/1/1601 to 1/1/1970 */

0 commit comments

Comments
 (0)