summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorjca <jca@openbsd.org>2017-12-11 23:31:16 +0000
committerjca <jca@openbsd.org>2017-12-11 23:31:16 +0000
commitbf42a57297a7820ffb58f87be4ec0f4da6006cdb (patch)
treee0fdff6a67426e1dc9a29bd3d5deb3523caf23f1 /sys
parentImplement support for the "next-generation" clock bindings for the (diff)
downloadwireguard-openbsd-bf42a57297a7820ffb58f87be4ec0f4da6006cdb.tar.xz
wireguard-openbsd-bf42a57297a7820ffb58f87be4ec0f4da6006cdb.zip
Proper do {} while (0) idiom in TIMESPEC_TO_TIMEVAL/TIMEVAL_TO_TIMESPEC
From Scott Cheloha, ok tb@
Diffstat (limited to 'sys')
-rw-r--r--sys/sys/time.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/sys/time.h b/sys/sys/time.h
index e2e1dd6bf5f..7bd9994d683 100644
--- a/sys/sys/time.h
+++ b/sys/sys/time.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: time.h,v 1.36 2016/09/12 19:41:20 guenther Exp $ */
+/* $OpenBSD: time.h,v 1.37 2017/12/11 23:31:16 jca Exp $ */
/* $NetBSD: time.h,v 1.18 1996/04/23 10:29:33 mycroft Exp $ */
/*
@@ -60,14 +60,14 @@ struct timespec {
};
#endif
-#define TIMEVAL_TO_TIMESPEC(tv, ts) { \
+#define TIMEVAL_TO_TIMESPEC(tv, ts) do { \
(ts)->tv_sec = (tv)->tv_sec; \
(ts)->tv_nsec = (tv)->tv_usec * 1000; \
-}
-#define TIMESPEC_TO_TIMEVAL(tv, ts) { \
+} while (0)
+#define TIMESPEC_TO_TIMEVAL(tv, ts) do { \
(tv)->tv_sec = (ts)->tv_sec; \
(tv)->tv_usec = (ts)->tv_nsec / 1000; \
-}
+} while (0)
struct timezone {
int tz_minuteswest; /* minutes west of Greenwich */