@@ -118,6 +118,38 @@ typedef unsigned LONG_LONG Py_uintptr_t;
118118
119119#endif /* !HAVE_SYS_SELECT_H */
120120
121+ /*******************************
122+ * stat() and fstat() fiddling *
123+ *******************************/
124+
125+ /* We expect that stat and fstat exist on most systems.
126+ * It's confirmed on Unix, Mac and Windows.
127+ * If you don't have them, add
128+ * #define DONT_HAVE_STAT
129+ * and/or
130+ * #define DONT_HAVE_FSTAT
131+ * to your config.h. Python code beyond this should check HAVE_STAT and
132+ * HAVE_FSTAT instead.
133+ * Also
134+ * #define DONT_HAVE_SYS_STAT_H
135+ * if <sys/stat.h> doesn't exist on your platform, and
136+ * #define HAVE_STAT_H
137+ * if <stat.h> does (don't look at me -- ths mess is inherited).
138+ */
139+ #ifndef DONT_HAVE_STAT
140+ #define HAVE_STAT
141+ #endif
142+
143+ #ifndef DONT_HAVE_FSTAT
144+ #define HAVE_FSTAT
145+ #endif
146+
147+ #ifndef DONT_HAVE_SYS_STAT_H
148+ #include <sys/stat.h>
149+ #elif defined(HAVE_STAT_H )
150+ #include <stat.h>
151+ #endif
152+
121153
122154#ifdef __cplusplus
123155/* Move this down here since some C++ #include's don't like to be included
@@ -192,7 +224,7 @@ extern int gethostname(char *, int);
192224#ifdef __BEOS__
193225/* Unchecked */
194226/* It's in the libs, but not the headers... - [cjh] */
195- int shutdown ( int , int );
227+ int shutdown ( int , int );
196228#endif
197229
198230#ifdef HAVE__GETPTY
@@ -305,7 +337,7 @@ extern double hypot(double, double);
305337#define sqrt sqrtd
306338#define tan tand
307339#define tanh tanhd
308- #endif
340+ #endif
309341
310342
311343/************************************
0 commit comments