1 /* woe-statpred.h --- macros S_IS{DIR,CHR,REG,BLK} for __MINGW32__
2  *
3  * Copyright (C) 2011-2013 Thien-Thi Nguyen
4  * Copyright (C) 2000, 2001, 2002, 2003 Stefan Jahn <stefan@lkcc.org>
5  * Copyright (C) 2000 Raimund Jacob <raimi@lkcc.org>
6  * Copyright (C) 1999 Martin Grabmueller <mgrabmue@cs.tu-berlin.de>
7  *
8  * This is free software; you can redistribute it and/or modify it
9  * under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 3, or (at your option)
11  * any later version.
12  *
13  * This software is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this package.  If not, see <http://www.gnu.org/licenses/>.
20  */
21 
22 #ifndef __WOE_STATPRED_H__
23 #define __WOE_STATPRED_H__ 1
24 
25 /*
26  * This little modification is necessary for the native Win32 compiler.
27  * We do have these macros defined in the MinGW32 and Cygwin headers
28  * but not within the native Win32 headers.
29  */
30 #ifndef S_ISDIR
31 # ifndef S_IFBLK
32 #  define S_IFBLK 0x3000
33 # endif
34 # define S_ISDIR(Mode) (((Mode) & S_IFMT) == S_IFDIR)
35 # define S_ISCHR(Mode) (((Mode) & S_IFMT) == S_IFCHR)
36 # define S_ISREG(Mode) (((Mode) & S_IFMT) == S_IFREG)
37 # define S_ISBLK(Mode) (((Mode) & S_IFMT) == S_IFBLK)
38 #endif /* not S_ISDIR */
39 
40 #endif  /* !defined __WOE_STATPRED_H__ */
41