Fix redefinition of clock_gettime
and clock_getres
winpthreads-git 12.0.0.r720 provides `clock_gettime` and `clock_getres` as inline functions.
This commit is contained in:
parent
f2e5f6dbb6
commit
3e47e7a499
Notes:
git
2025-05-11 17:50:39 +00:00
@ -126,8 +126,15 @@ typedef unsigned int uintptr_t;
|
|||||||
#define O_SHARE_DELETE 0x20000000 /* for rb_w32_open(), rb_w32_wopen() */
|
#define O_SHARE_DELETE 0x20000000 /* for rb_w32_open(), rb_w32_wopen() */
|
||||||
|
|
||||||
typedef int clockid_t;
|
typedef int clockid_t;
|
||||||
|
#if defined(__MINGW32__)
|
||||||
|
#undef CLOCK_PROCESS_CPUTIME_ID
|
||||||
|
#undef CLOCK_THREAD_CPUTIME_ID
|
||||||
|
#undef CLOCK_REALTIME_COARSE
|
||||||
|
#endif
|
||||||
|
#if defined(HAVE_CLOCK_GETTIME) && !defined(CLOCK_REALTIME)
|
||||||
#define CLOCK_REALTIME 0
|
#define CLOCK_REALTIME 0
|
||||||
#define CLOCK_MONOTONIC 1
|
#define CLOCK_MONOTONIC 1
|
||||||
|
#endif
|
||||||
|
|
||||||
#undef utime
|
#undef utime
|
||||||
#undef lseek
|
#undef lseek
|
||||||
|
@ -4761,6 +4761,7 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
|
|||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#if !defined(__MINGW32__) || !defined(HAVE_CLOCK_GETTIME)
|
||||||
/* License: Ruby's */
|
/* License: Ruby's */
|
||||||
int
|
int
|
||||||
clock_gettime(clockid_t clock_id, struct timespec *sp)
|
clock_gettime(clockid_t clock_id, struct timespec *sp)
|
||||||
@ -4800,7 +4801,9 @@ clock_gettime(clockid_t clock_id, struct timespec *sp)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#if !defined(__MINGW32__) || !defined(HAVE_CLOCK_GETRES)
|
||||||
/* License: Ruby's */
|
/* License: Ruby's */
|
||||||
int
|
int
|
||||||
clock_getres(clockid_t clock_id, struct timespec *sp)
|
clock_getres(clockid_t clock_id, struct timespec *sp)
|
||||||
@ -4828,6 +4831,7 @@ clock_getres(clockid_t clock_id, struct timespec *sp)
|
|||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
#endif
|
||||||
|
|
||||||
/* License: Ruby's */
|
/* License: Ruby's */
|
||||||
static char *
|
static char *
|
||||||
|
Loading…
x
Reference in New Issue
Block a user