Skip to content
This repository was archived by the owner on Apr 24, 2025. It is now read-only.

Commit a269426

Browse files
committed
fix time limit for Windows
1 parent 2539b8a commit a269426

File tree

1 file changed

+9
-6
lines changed

1 file changed

+9
-6
lines changed

src/regexec.c

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -68,25 +68,28 @@ search_in_range(regex_t* reg, const UChar* str, const UChar* end, const UChar* s
6868

6969
#ifdef USE_TIME_LIMIT
7070
#if defined(_WIN32) && !defined(__GNUC__)
71+
72+
#include <windows.h>
73+
74+
#define CLOCK_REALTIME 0
75+
7176
struct timespec {
72-
long tv_sec;
73-
long tv_nsec;
77+
time_t tv_sec;
78+
long tv_nsec;
7479
};
7580

7681
static int
77-
clock_gettime(int, struct timespec *ts)
82+
clock_gettime(int unused, struct timespec *ts)
7883
{
7984
__int64 t;
8085

8186
GetSystemTimeAsFileTime((FILETIME* )&t);
8287
t -=116444736000000000i64;
83-
ts->tv_sec = t / 10000000i64;
88+
ts->tv_sec = (time_t )(t / 10000000i64);
8489
ts->tv_nsec = t % 10000000i64 *100;
8590
return 0;
8691
}
8792

88-
#define TIME_T_MAX LONG_MAX
89-
9093
#else /* defined(_WIN32) && !defined(__GNUC__) */
9194

9295
#include <time.h>

0 commit comments

Comments
 (0)