From 172e6378f86962ea07e6cf9e6877c1791c3aa2f1 Mon Sep 17 00:00:00 2001 From: Steve Holme Date: Tue, 5 Mar 2013 19:45:51 +0000 Subject: curl_setup.h: Added S_IRDIR() macro for compilers that don't support it Commit 26eaa8383001 introduces the use of S_ISDIR() yet some compilers, such as MSVC don't support it, so we must define a substitute using file flags and mask. --- lib/curl_setup.h | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/lib/curl_setup.h b/lib/curl_setup.h index ad83fec5f..e4d8721a0 100644 --- a/lib/curl_setup.h +++ b/lib/curl_setup.h @@ -7,7 +7,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2012, Daniel Stenberg, , et al. + * Copyright (C) 1998 - 2013, Daniel Stenberg, , et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -694,4 +694,9 @@ int netware_init(void); #define S_ISREG(m) (((m) & S_IFMT) == S_IFREG) #endif +/* Define S_ISDIR if not defined by system headers, f.e. MSVC */ +#if !defined(S_ISDIR) && defined(S_IFMT) && defined(S_IFDIR) +#define S_ISDIR(m) (((m) & S_IFMT) == S_IFDIR) +#endif + #endif /* HEADER_CURL_SETUP_H */ -- cgit v1.2.3