File tree 2 files changed +36
-37
lines changed
2 files changed +36
-37
lines changed Original file line number Diff line number Diff line change 1
1
#ifndef Py_FILEUTILS_H
2
2
#define Py_FILEUTILS_H
3
+
4
+ /*******************************
5
+ * stat() and fstat() fiddling *
6
+ *******************************/
7
+
8
+ #ifdef HAVE_SYS_STAT_H
9
+ # include <sys/stat.h> // S_ISREG()
10
+ #elif defined(HAVE_STAT_H )
11
+ # include <stat.h> // S_ISREG()
12
+ #endif
13
+
14
+ #ifndef S_IFMT
15
+ // VisualAge C/C++ Failed to Define MountType Field in sys/stat.h.
16
+ # define S_IFMT 0170000
17
+ #endif
18
+ #ifndef S_IFLNK
19
+ // Windows doesn't define S_IFLNK, but posixmodule.c maps
20
+ // IO_REPARSE_TAG_SYMLINK to S_IFLNK.
21
+ # define S_IFLNK 0120000
22
+ #endif
23
+ #ifndef S_ISREG
24
+ # define S_ISREG (x ) (((x) & S_IFMT) == S_IFREG)
25
+ #endif
26
+ #ifndef S_ISDIR
27
+ # define S_ISDIR (x ) (((x) & S_IFMT) == S_IFDIR)
28
+ #endif
29
+ #ifndef S_ISCHR
30
+ # define S_ISCHR (x ) (((x) & S_IFMT) == S_IFCHR)
31
+ #endif
32
+ #ifndef S_ISLNK
33
+ # define S_ISLNK (x ) (((x) & S_IFMT) == S_IFLNK)
34
+ #endif
35
+
36
+
37
+ // Move this down here since some C++ #include's don't like to be included
38
+ // inside an extern "C".
3
39
#ifdef __cplusplus
4
40
extern "C" {
5
41
#endif
Original file line number Diff line number Diff line change @@ -184,43 +184,6 @@ typedef Py_ssize_t Py_ssize_clean_t;
184
184
# define Py_MEMCPY memcpy
185
185
#endif
186
186
187
- /* ******************************
188
- * stat() and fstat() fiddling *
189
- *******************************/
190
-
191
- #ifdef HAVE_SYS_STAT_H
192
- #include < sys/stat.h>
193
- #elif defined(HAVE_STAT_H)
194
- #include < stat.h>
195
- #endif
196
-
197
- #ifndef S_IFMT
198
- /* VisualAge C/C++ Failed to Define MountType Field in sys/stat.h */
199
- #define S_IFMT 0170000
200
- #endif
201
-
202
- #ifndef S_IFLNK
203
- /* Windows doesn't define S_IFLNK but posixmodule.c maps
204
- * IO_REPARSE_TAG_SYMLINK to S_IFLNK */
205
- # define S_IFLNK 0120000
206
- #endif
207
-
208
- #ifndef S_ISREG
209
- #define S_ISREG (x ) (((x) & S_IFMT) == S_IFREG)
210
- #endif
211
-
212
- #ifndef S_ISDIR
213
- #define S_ISDIR (x ) (((x) & S_IFMT) == S_IFDIR)
214
- #endif
215
-
216
- #ifndef S_ISCHR
217
- #define S_ISCHR (x ) (((x) & S_IFMT) == S_IFCHR)
218
- #endif
219
-
220
- #ifndef S_ISLNK
221
- #define S_ISLNK (x ) (((x) & S_IFMT) == S_IFLNK)
222
- #endif
223
-
224
187
#ifdef __cplusplus
225
188
/* Move this down here since some C++ #include's don't like to be included
226
189
inside an extern "C" */
You can’t perform that action at this time.
0 commit comments