summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/ruby/win32.h17
-rw-r--r--win32/win32.c4
2 files changed, 8 insertions, 13 deletions
diff --git a/include/ruby/win32.h b/include/ruby/win32.h
index be3a1cce96..69e92ed9ff 100644
--- a/include/ruby/win32.h
+++ b/include/ruby/win32.h
@@ -127,15 +127,14 @@ typedef unsigned int uintptr_t;
typedef int clockid_t;
-/* defined in win32/win32.c for old versions */
-#if !defined(__MINGW32__) || !defined(HAVE_CLOCK_GETTIME)
-# define HAVE_CLOCK_GETTIME 1
-# define NEED_CLOCK_GETTIME 1
-#endif
-#if !defined(__MINGW32__) || !defined(HAVE_CLOCK_GETRES)
-# define HAVE_CLOCK_GETRES 1
-# define NEED_CLOCK_GETRES 1
-#endif
+/*
+ * Since we use our versions in win32/win32.c, not to depend on yet
+ * another DLL, prefix our versions not to conflict with inline
+ * versions provided in time.h.
+ */
+#define clock_gettime rb_w32_clock_gettime
+#define clock_getres rb_w32_clock_getres
+
#ifndef CLOCK_REALTIME
# define CLOCK_REALTIME 0
#endif
diff --git a/win32/win32.c b/win32/win32.c
index 9095b1a251..c13c4e1732 100644
--- a/win32/win32.c
+++ b/win32/win32.c
@@ -4761,7 +4761,6 @@ gettimeofday(struct timeval *tv, struct timezone *tz)
return 0;
}
-#ifdef NEED_CLOCK_GETTIME
/* License: Ruby's */
static FILETIME
filetimes_plus(FILETIME t1, FILETIME t2)
@@ -4839,9 +4838,7 @@ clock_gettime(clockid_t clock_id, struct timespec *sp)
return -1;
}
}
-#endif
-#ifdef NEED_CLOCK_GETRES
/* License: Ruby's */
int
clock_getres(clockid_t clock_id, struct timespec *sp)
@@ -4878,7 +4875,6 @@ clock_getres(clockid_t clock_id, struct timespec *sp)
return -1;
}
}
-#endif
/* License: Ruby's */
static char *