summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorDana Robinson <derobins@hdfgroup.org>2021-03-09 20:44:41 (GMT)
committerDana Robinson <derobins@hdfgroup.org>2021-03-09 20:44:41 (GMT)
commitf0c562554f2233e00ca6548d6143b653f1041b72 (patch)
tree4b514d2c20c57766ef6dce13408cd82c7312ef6e /test
parent829432e3fd5eb93347f195be7964962089515390 (diff)
downloadhdf5-f0c562554f2233e00ca6548d6143b653f1041b72.zip
hdf5-f0c562554f2233e00ca6548d6143b653f1041b72.tar.gz
hdf5-f0c562554f2233e00ca6548d6143b653f1041b72.tar.bz2
Hides use of clock_gettime() on Windows
timespec_get() is C11 and probably only has about 10 ms resolution. We may have to revisit this.
Diffstat (limited to 'test')
-rw-r--r--test/vfd_swmr_common.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/test/vfd_swmr_common.c b/test/vfd_swmr_common.c
index 1c8d7b3..6d4e464 100644
--- a/test/vfd_swmr_common.c
+++ b/test/vfd_swmr_common.c
@@ -52,7 +52,12 @@ below_speed_limit(struct timespec *last, const struct timespec *ival)
HDassert(0 <= last->tv_nsec && last->tv_nsec < 1000000000L);
HDassert(0 <= ival->tv_nsec && ival->tv_nsec < 1000000000L);
+ /* NOTE: timespec_get() is C11. This may need further tweaks. */
+#ifdef H5_HAVE_WIN32_API
+ if (timespec_get(&now, TIME_UTC) != TIME_UTC) {
+#else
if (HDclock_gettime(CLOCK_MONOTONIC, &now) == -1) {
+#endif
HDfprintf(stderr, "%s: clock_gettime", __func__);
HDexit(EXIT_FAILURE);
}