]> granicus.if.org Git - python/commitdiff
Issue #11016: Try to fix compilaton of the new _stat.c module on Windows
authorVictor Stinner <victor.stinner@gmail.com>
Sat, 22 Jun 2013 23:49:42 +0000 (01:49 +0200)
committerVictor Stinner <victor.stinner@gmail.com>
Sat, 22 Jun 2013 23:49:42 +0000 (01:49 +0200)
Include/pyport.h
Modules/_stat.c

index eb1bbe20ec60db34d9eb785d610a0f664af69cf4..4b9c238b9f33974e6482e4351af87ce5abb5f9a7 100644 (file)
@@ -406,6 +406,14 @@ typedef size_t Py_uhash_t;
 #define S_ISDIR(x) (((x) & S_IFMT) == S_IFDIR)
 #endif
 
+#ifndef S_ISCHR
+#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
index 41a5a09d7135251f21ed2400117b9fd89549df14..aaf6fe5ca29cb4b6a6832225d47972e6953fd51d 100644 (file)
@@ -26,6 +26,10 @@ extern "C" {
 #include <sys/stat.h>
 #endif /* HAVE_SYS_STAT_H */
 
+#ifdef MS_WINDOWS
+typedef unsigned short mode_t;
+#endif
+
 /* From Python's stat.py */
 #ifndef S_IMODE
 #  define S_IMODE 07777