mirror of
https://github.com/python/cpython.git
synced 2025-08-04 17:08:35 +00:00
Define S_IFMT and S_IFLNK in pyport.h so posixmodule.c can use named constants instead
of arbitrary looking numbers.
This commit is contained in:
parent
9975877f46
commit
99d6135a15
2 changed files with 10 additions and 9 deletions
|
@ -393,9 +393,15 @@ typedef size_t Py_uhash_t;
|
|||
#include <stat.h>
|
||||
#endif
|
||||
|
||||
#if defined(PYCC_VACPP)
|
||||
#ifndef S_IFMT
|
||||
/* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
|
||||
#define S_IFMT (S_IFDIR|S_IFCHR|S_IFREG)
|
||||
#define S_IFMT 0170000
|
||||
#endif
|
||||
|
||||
#ifndef S_IFLNK
|
||||
/* Windows doesn't define S_IFLNK but posixmodule.c maps
|
||||
* IO_REPARSE_TAG_SYMLINK to S_IFLNK */
|
||||
# define S_IFLNK 0120000
|
||||
#endif
|
||||
|
||||
#ifndef S_ISREG
|
||||
|
@ -410,11 +416,6 @@ typedef size_t Py_uhash_t;
|
|||
#define S_ISCHR(x) (((x) & S_IFMT) == S_IFCHR)
|
||||
#endif
|
||||
|
||||
#ifndef S_ISBLK
|
||||
#define S_ISBLK(x) (((x) & S_IFMT) == S_IFBLK)
|
||||
#endif
|
||||
|
||||
|
||||
#ifdef __cplusplus
|
||||
/* Move this down here since some C++ #include's don't like to be included
|
||||
inside an extern "C" */
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue