Commit 5b2f1841 authored by Christian Heimes's avatar Christian Heimes

Issue #11016: Don't define macros and constants that are already set by pyport.h

parent 99d6135a
...@@ -39,35 +39,18 @@ typedef unsigned short mode_t; ...@@ -39,35 +39,18 @@ typedef unsigned short mode_t;
* *
* Only the names are defined by POSIX but not their value. All common file * Only the names are defined by POSIX but not their value. All common file
* types seems to have the same numeric value on all platforms, though. * types seems to have the same numeric value on all platforms, though.
*
* pyport.h guarantees S_IFMT, S_IFDIR, S_IFCHR, S_IFREG and S_IFLNK
*/ */
#ifndef S_IFMT
# define S_IFMT 0170000
#endif
#ifndef S_IFDIR
# define S_IFDIR 0040000
#endif
#ifndef S_IFCHR
# define S_IFCHR 0020000
#endif
#ifndef S_IFBLK #ifndef S_IFBLK
# define S_IFBLK 0060000 # define S_IFBLK 0060000
#endif #endif
#ifndef S_IFREG
# define S_IFREG 0100000
#endif
#ifndef S_IFIFO #ifndef S_IFIFO
# define S_IFIFO 0010000 # define S_IFIFO 0010000
#endif #endif
#ifndef S_IFLNK
# define S_IFLNK 0120000
#endif
#ifndef S_IFSOCK #ifndef S_IFSOCK
# define S_IFSOCK 0140000 # define S_IFSOCK 0140000
#endif #endif
...@@ -85,23 +68,14 @@ typedef unsigned short mode_t; ...@@ -85,23 +68,14 @@ typedef unsigned short mode_t;
#endif #endif
/* S_ISXXX() */ /* S_ISXXX()
#ifndef S_ISDIR * pyport.h defines S_ISDIR(), S_ISREG() and S_ISCHR()
# define S_ISDIR(mode) (((mode) & S_IFMT) == S_IFDIR) */
#endif
#ifndef S_ISCHR
# define S_ISCHR(mode) (((mode) & S_IFMT) == S_IFCHR)
#endif
#ifndef S_ISBLK #ifndef S_ISBLK
# define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK) # define S_ISBLK(mode) (((mode) & S_IFMT) == S_IFBLK)
#endif #endif
#ifndef S_ISREG
# define S_ISREG(mode) (((mode) & S_IFMT) == S_IFREG)
#endif
#ifndef S_ISFIFO #ifndef S_ISFIFO
# define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO) # define S_ISFIFO(mode) (((mode) & S_IFMT) == S_IFIFO)
#endif #endif
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment