Files
MINGW-packages/mingw-w64-python3/0190-MINGW-detect-REPARSE_DATA_BUFFER.patch
2016-07-12 14:49:26 +03:00

76 lines
2.7 KiB
Diff

diff -Naur Python-3.5.2-orig/configure.ac Python-3.5.2/configure.ac
--- Python-3.5.2-orig/configure.ac 2016-07-12 14:20:47.973300700 +0300
+++ Python-3.5.2/configure.ac 2016-07-12 14:20:48.333800700 +0300
@@ -3940,6 +3940,27 @@
AC_DEFINE(HAVE_SOCKADDR_STORAGE, 1, [struct sockaddr_storage (sys/socket.h)])
fi
+case $host in
+ *-*-mingw*)
+ dnl See Modules/posixmodule.c for details.
+ dnl Also check below distinguish wingw and mingw-w64
+ AC_MSG_CHECKING([for REPARSE_DATA_BUFFER])
+ AC_COMPILE_IFELSE([AC_LANG_PROGRAM([
+#include <windows.h>
+#include <winnt.h>
+], [
+ REPARSE_DATA_BUFFER rdb
+])],
+ [py_reparse_data_buffer=yes],
+ [py_reparse_data_buffer=no]
+ )
+ AC_MSG_RESULT([$py_reparse_data_buffer])
+ if test yes = $py_reparse_data_buffer; then
+ AC_DEFINE([HAVE_REPARSE_DATA_BUFFER],[1],[Define to 1 if you have the 'REPARSE_DATA_BUFFER' structure.])
+ fi
+ ;;
+esac
+
# checks for compiler characteristics
AC_C_CHAR_UNSIGNED
diff -Naur Python-3.5.2-orig/Modules/winreparse.h Python-3.5.2/Modules/winreparse.h
--- Python-3.5.2-orig/Modules/winreparse.h 2016-06-26 00:38:38.000000000 +0300
+++ Python-3.5.2/Modules/winreparse.h 2016-07-12 14:20:48.344300700 +0300
@@ -12,6 +12,15 @@
http://msdn.microsoft.com/en-us/library/ff552012.aspx as the required
include doesn't seem to be present in the Windows SDK (at least as included
with Visual Studio Express). */
+#ifndef HAVE_REPARSE_DATA_BUFFER
+/*
+ * REPARSE_DATA_BUFFER is defined in <winnt.h> on mingw.org w32api
+ * instead as is documented in <ntifs.h>. The mingw-w64 API define
+ * it in <ddk/ntifs.h> but we can not include as header like
+ * <ntddk.h> is required instead <ddk/ntddk.h>, i.e. to use mingw-w64
+ * headers user must specify explicitly path to ddk :(.
+ * So lest check at configure time and use MSC hack if not found.
+ */
typedef struct _REPARSE_DATA_BUFFER {
ULONG ReparseTag;
USHORT ReparseDataLength;
@@ -42,7 +51,11 @@
#define REPARSE_DATA_BUFFER_HEADER_SIZE FIELD_OFFSET(REPARSE_DATA_BUFFER,\
GenericReparseBuffer)
+#ifndef MAXIMUM_REPARSE_DATA_BUFFER_SIZE
#define MAXIMUM_REPARSE_DATA_BUFFER_SIZE ( 16 * 1024 )
+#endif
+
+#endif /*ndef HAVE_REPARSE_DATA_BUFFER*/
#ifdef __cplusplus
}
diff -Naur Python-3.5.2-orig/pyconfig.h.in Python-3.5.2/pyconfig.h.in
--- Python-3.5.2-orig/pyconfig.h.in 2016-07-12 14:20:34.795800700 +0300
+++ Python-3.5.2/pyconfig.h.in 2016-07-12 14:20:48.350300700 +0300
@@ -717,6 +717,9 @@
/* Define if readline supports append_history */
#undef HAVE_RL_APPEND_HISTORY
+/* Define to 1 if you have the 'REPARSE_DATA_BUFFER' structure. */
+#undef HAVE_REPARSE_DATA_BUFFER
+
/* Define if you have readline 2.1 */
#undef HAVE_RL_CALLBACK