From: Victor Stinner Date: Sat, 22 Jun 2013 23:49:42 +0000 (+0200) Subject: Issue #11016: Try to fix compilaton of the new _stat.c module on Windows X-Git-Tag: v3.4.0a1~423 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=c6ebd16a203b84de020fb236f32e8c58db92718d;p=python Issue #11016: Try to fix compilaton of the new _stat.c module on Windows --- diff --git a/Include/pyport.h b/Include/pyport.h index eb1bbe20ec..4b9c238b9f 100644 --- a/Include/pyport.h +++ b/Include/pyport.h @@ -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 diff --git a/Modules/_stat.c b/Modules/_stat.c index 41a5a09d71..aaf6fe5ca2 100644 --- a/Modules/_stat.c +++ b/Modules/_stat.c @@ -26,6 +26,10 @@ extern "C" { #include #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