Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 5b2f184

Browse files
committed
Issue #11016: Don't define macros and constants that are already set by pyport.h
1 parent 99d6135 commit 5b2f184

1 file changed

Lines changed: 5 additions & 31 deletions

File tree

Modules/_stat.c

Lines changed: 5 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -39,35 +39,18 @@ typedef unsigned short mode_t;
3939
*
4040
* Only the names are defined by POSIX but not their value. All common file
4141
* types seems to have the same numeric value on all platforms, though.
42+
*
43+
* pyport.h guarantees S_IFMT, S_IFDIR, S_IFCHR, S_IFREG and S_IFLNK
4244
*/
43-
#ifndef S_IFMT
44-
# define S_IFMT 0170000
45-
#endif
46-
47-
#ifndef S_IFDIR
48-
# define S_IFDIR 0040000
49-
#endif
50-
51-
#ifndef S_IFCHR
52-
# define S_IFCHR 0020000
53-
#endif
5445

5546
#ifndef S_IFBLK
5647
# define S_IFBLK 0060000
5748
#endif
5849

59-
#ifndef S_IFREG
60-
# define S_IFREG 0100000
61-
#endif
62-
6350
#ifndef S_IFIFO
6451
# define S_IFIFO 0010000
6552
#endif
6653

67-
#ifndef S_IFLNK
68-
# define S_IFLNK 0120000
69-
#endif
70-
7154
#ifndef S_IFSOCK
7255
# define S_IFSOCK 0140000
7356
#endif
@@ -85,23 +68,14 @@ typedef unsigned short mode_t;
8568
#endif
8669

8770

88-
/* S_ISXXX() */
89-
#ifndef S_ISDIR
90-
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR)
91-
#endif
92-
93-
#ifndef S_ISCHR
94-
# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
95-
#endif
71+
/* S_ISXXX()
72+
* pyport.h defines S_ISDIR(), S_ISREG() and S_ISCHR()
73+
*/
9674

9775
#ifndef S_ISBLK
9876
# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
9977
#endif
10078

101-
#ifndef S_ISREG
102-
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
103-
#endif
104-
10579
#ifndef S_ISFIFO
10680
# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
10781
#endif

0 commit comments

Comments
 (0)