From 492cbbed865ac98e4faa31d7714feeb09f5c418a Mon Sep 17 00:00:00 2001 From: Samuel Thibault Date: Sun, 3 Sep 2017 17:48:33 +0200 Subject: hurd: Fix build ot misc/tst-preadvwritev2-common.c * misc/tst-preadvwritev2-common.c (RWF_HIPRI, RWF_DSYNC, RWF_SYNC, RWF_NOWAIT): Define to 0 if undefined already. (do_test_with_invalid_flags): Set invalid_flag to 2 if RWF_SUPPORTED boils down to 0. --- misc/tst-preadvwritev2-common.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'misc') diff --git a/misc/tst-preadvwritev2-common.c b/misc/tst-preadvwritev2-common.c index 8abedc14d0..9d4909bdb7 100644 --- a/misc/tst-preadvwritev2-common.c +++ b/misc/tst-preadvwritev2-common.c @@ -22,9 +22,21 @@ static void do_test_with_invalid_flags (void) { +#ifndef RWF_HIPRI +# define RWF_HIPRI 0 +#endif +#ifndef RWF_DSYNC +# define RWF_DSYNC 0 +#endif +#ifndef RWF_SYNC +# define RWF_SYNC 0 +#endif +#ifndef RWF_NOWAIT +# define RWF_NOWAIT 0 +#endif #define RWF_SUPPORTED (RWF_HIPRI | RWF_DSYNC | RWF_SYNC | RWF_NOWAIT) /* Set the next bit from the mask of all supported flags. */ - int invalid_flag = __builtin_clz (RWF_SUPPORTED); + int invalid_flag = RWF_SUPPORTED != 0 ? __builtin_clz (RWF_SUPPORTED) : 2; invalid_flag = 0x1 << ((sizeof (int) * CHAR_BIT) - invalid_flag); char buf[32]; -- cgit 1.4.1