From 841183210311b1d4ffb4084bfde8fa8bdf3e6757 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 29 Oct 2022 21:55:14 -0700 Subject: [PROPOSED] Pacify compilers re #undef HAVE_GETRANDOM * zic.c (HAVE_GETRANDOM): Do not rely on this macro evaluating to zero if undefined in an #if. Although the C standard guarantees this, some compilers warn about it. --- zic.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/zic.c b/zic.c index f06058ff..a85f2a4c 100644 --- a/zic.c +++ b/zic.c @@ -41,9 +41,7 @@ static zic_t const # define mkdir(name, mode) _mkdir(name) #endif -#if HAVE_GETRANDOM -# include -#elif !defined HAVE_GETRANDOM +#ifndef HAVE_GETRANDOM # ifdef __has_include # if __has_include() # include @@ -52,6 +50,8 @@ static zic_t const # include # endif # define HAVE_GETRANDOM GRND_RANDOM +#elif HAVE_GETRANDOM +# include #endif #if HAVE_SYS_STAT_H -- 2.37.2