]> granicus.if.org Git - python/commitdiff
Really fix issue #10898: posixmodule.c redefines FSTAT
authorAntoine Pitrou <solipsis@pitrou.net>
Fri, 1 Jul 2011 20:56:03 +0000 (22:56 +0200)
committerAntoine Pitrou <solipsis@pitrou.net>
Fri, 1 Jul 2011 20:56:03 +0000 (22:56 +0200)
Modules/posixmodule.c

index 2431e1cb5fa36c583367d6b888c9bf70f40c59e6..fbd343bdb9df18f292e0840b34f6c8c72853bad9 100644 (file)
@@ -338,20 +338,6 @@ extern int lstat(const char *, struct stat *);
 #define USE_TMPNAM_R
 #endif
 
-/* choose the appropriate stat and fstat functions and return structs */
-#undef STAT
-#undef FSTAT
-#undef STRUCT_STAT
-#if defined(MS_WIN64) || defined(MS_WINDOWS)
-#       define STAT win32_stat
-#       define FSTAT win32_fstat
-#       define STRUCT_STAT struct win32_stat
-#else
-#       define STAT stat
-#       define FSTAT fstat
-#       define STRUCT_STAT struct stat
-#endif
-
 #if defined(MAJOR_IN_MKDEV)
 #include <sys/mkdev.h>
 #else
@@ -842,6 +828,20 @@ win32_wchdir(LPCWSTR path)
 }
 #endif
 
+/* choose the appropriate stat and fstat functions and return structs */
+#undef STAT
+#undef FSTAT
+#undef STRUCT_STAT
+#if defined(MS_WIN64) || defined(MS_WINDOWS)
+#       define STAT win32_stat
+#       define FSTAT win32_fstat
+#       define STRUCT_STAT struct win32_stat
+#else
+#       define STAT stat
+#       define FSTAT fstat
+#       define STRUCT_STAT struct stat
+#endif
+
 #ifdef MS_WINDOWS
 /* The CRT of Windows has a number of flaws wrt. its stat() implementation:
    - time stamps are restricted to second resolution