From ab434a6fc826dd7eccd38b7e2a60f0fe1362b9de Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Wed, 31 Jan 2018 11:46:49 -0800 Subject: [PROPOSED] Port directory testing to MS-Windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From a suggestion by Manuela Friedrich in: https://mm.icann.org/pipermail/tz/2018-January/026105.html * zic.c (S_ISDIR): Define if sys/stat.h doesn’t, but defines the ancient UNIX macros S_IFDIR and S_IFMT. --- zic.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/zic.c b/zic.c index dc1a612..55c83e9 100644 --- a/zic.c +++ b/zic.c @@ -41,6 +41,10 @@ typedef int_fast64_t zic_t; #else #define MKDIR_UMASK 0755 #endif +/* Port to native MS-Windows and to ancient UNIX. */ +#if !defined S_ISDIR && defined S_IFDIR && defined S_IFMT +# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) +#endif #if HAVE_SYS_WAIT_H #include /* for WIFEXITED and WEXITSTATUS */ -- 2.14.3