File tree Expand file tree Collapse file tree 2 files changed +18
-5
lines changed
Expand file tree Collapse file tree 2 files changed +18
-5
lines changed Original file line number Diff line number Diff line change @@ -127,13 +127,26 @@ typedef unsigned int uintptr_t;
127127
128128typedef int clockid_t ;
129129#if defined(__MINGW32__ )
130+ /* I don't know why but these return some strange values. */
130131#undef CLOCK_PROCESS_CPUTIME_ID
131132#undef CLOCK_THREAD_CPUTIME_ID
132133#undef CLOCK_REALTIME_COARSE
133134#endif
134- #if defined(HAVE_CLOCK_GETTIME ) && !defined(CLOCK_REALTIME )
135- #define CLOCK_REALTIME 0
136- #define CLOCK_MONOTONIC 1
135+
136+ /* defined in win32/win32.c for old versions */
137+ #if !defined(__MINGW32__ ) || !defined(HAVE_CLOCK_GETTIME )
138+ # define HAVE_CLOCK_GETTIME 1
139+ # define NEED_CLOCK_GETTIME 1
140+ #endif
141+ #if !defined(__MINGW32__ ) || !defined(HAVE_CLOCK_GETRES )
142+ # define HAVE_CLOCK_GETRES 1
143+ # define NEED_CLOCK_GETRES 1
144+ #endif
145+ #ifndef CLOCK_REALTIME
146+ # define CLOCK_REALTIME 0
147+ #endif
148+ #ifndef CLOCK_MONOTONIC
149+ # define CLOCK_MONOTONIC 1
137150#endif
138151
139152#undef utime
Original file line number Diff line number Diff line change @@ -4761,7 +4761,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
47614761 return 0 ;
47624762}
47634763
4764- #if !defined( __MINGW32__ ) || !defined( HAVE_CLOCK_GETTIME )
4764+ #ifdef NEED_CLOCK_GETTIME
47654765/* License: Ruby's */
47664766int
47674767clock_gettime (clockid_t clock_id , struct timespec * sp )
@@ -4803,7 +4803,7 @@ clock_gettime(clockid_t clock_id, struct timespec *sp)
48034803}
48044804#endif
48054805
4806- #if !defined( __MINGW32__ ) || !defined( HAVE_CLOCK_GETRES )
4806+ #ifdef NEED_CLOCK_GETRES
48074807/* License: Ruby's */
48084808int
48094809clock_getres (clockid_t clock_id , struct timespec * sp )
You can’t perform that action at this time.
0 commit comments