summaryrefslogtreecommitdiffstats
path: root/Include/pyport.h
diff options
context:
space:
mode:
authorChristian Heimes <christian@cheimes.de>2013-06-23 21:56:05 (GMT)
committerChristian Heimes <christian@cheimes.de>2013-06-23 21:56:05 (GMT)
commit99d6135a157f6626fddd5d61007d363b3a14990d (patch)
treee6c96449223f2f1c4632e45393cacb5106a4b96b /Include/pyport.h
parent9975877f46efeade3f4af5aa875fc1a256512f1f (diff)
downloadcpython-99d6135a157f6626fddd5d61007d363b3a14990d.zip
cpython-99d6135a157f6626fddd5d61007d363b3a14990d.tar.gz
cpython-99d6135a157f6626fddd5d61007d363b3a14990d.tar.bz2
Define S_IFMT and S_IFLNK in pyport.h so posixmodule.c can use named constants instead
of arbitrary looking numbers.
Diffstat (limited to 'Include/pyport.h')
-rw-r--r--Include/pyport.h15
1 files changed, 8 insertions, 7 deletions
diff --git a/Include/pyport.h b/Include/pyport.h
index 4b9c238..f16cce9 100644
--- a/Include/pyport.h
+++ b/Include/pyport.h
@@ -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" */