summaryrefslogtreecommitdiff
path: root/include/ruby
diff options
context:
space:
mode:
authornagachika <nagachika@ruby-lang.org>2025-05-17 15:41:00 +0900
committernagachika <nagachika@ruby-lang.org>2025-05-17 15:41:00 +0900
commita3adc05a4e1f5c5d1cd95eee92da9693b23360bf (patch)
tree52b1b3dc7d9bb036dcc98b9eaa8cadb3c9f16b6a /include/ruby
parentb1b6752fbeb2d23dbea639bd4b331c9e8b56f49c (diff)
merge revision(s) 3e47e7a499acd256be549935fcb559d3c82e556c, 46e4c8673747de96838d2c5dec37446d23d99d88:
Fix redefinition of `clock_gettime` and `clock_getres` winpthreads-git 12.0.0.r720 provides `clock_gettime` and `clock_getres` as inline functions. Detect `clock_gettime` and `clock_getres` for winpthreads
Diffstat (limited to 'include/ruby')
-rw-r--r--include/ruby/win32.h7
1 files changed, 7 insertions, 0 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index dfb56f4182..cfa31db130 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -125,8 +125,15 @@ typedef unsigned int uintptr_t;
#define O_SHARE_DELETE 0x20000000 /* for rb_w32_open(), rb_w32_wopen() */
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_MONOTONIC 1
+#endif
#undef utime
#undef lseek