Files
MINGW-packages/mingw-w64-python3/0200-MINGW-build-in-windows-modules-winreg.patch
2015-09-21 15:47:39 +03:00

64 lines
2.0 KiB
Diff

diff -Naur Python-3.5.0-orig/configure.ac Python-3.5.0/configure.ac
--- Python-3.5.0-orig/configure.ac 2015-09-21 13:41:15.569292500 +0300
+++ Python-3.5.0/configure.ac 2015-09-21 13:41:15.713278100 +0300
@@ -2742,6 +2742,14 @@
fi])
AC_MSG_RESULT($with_dbmliborder)
+
+# Determine if windows modules should be used.
+AC_SUBST(USE_WIN32_MODULE)
+USE_WIN32_MODULE='#'
+case $host in
+ *-*-mingw*) USE_WIN32_MODULE=;;
+esac
+
# Determine if signalmodule should be used.
AC_SUBST(USE_SIGNAL_MODULE)
AC_SUBST(SIGNAL_OBJS)
diff -Naur Python-3.5.0-orig/Modules/Setup.config.in Python-3.5.0/Modules/Setup.config.in
--- Python-3.5.0-orig/Modules/Setup.config.in 2015-09-21 13:41:14.300419400 +0300
+++ Python-3.5.0/Modules/Setup.config.in 2015-09-21 13:41:15.757273700 +0300
@@ -12,8 +12,11 @@
# Threading
@USE_THREAD_MODULE@_thread _threadmodule.c
# The signal module
-@USE_SIGNAL_MODULE@_signal signalmodule.c
+@USE_SIGNAL_MODULE@_signal signalmodule.c -lws2_32
+# build-in modules for windows platform:
+@USE_WIN32_MODULE@winreg ../PC/winreg.c
+
# The rest of the modules previously listed in this file are built
# by the setup.py script in Python 2.1 and later.
diff -Naur Python-3.5.0-orig/PC/winreg.c Python-3.5.0/PC/winreg.c
--- Python-3.5.0-orig/PC/winreg.c 2015-09-13 14:41:25.000000000 +0300
+++ Python-3.5.0/PC/winreg.c 2015-09-21 13:41:15.767272700 +0300
@@ -16,6 +16,25 @@
#include "structmember.h"
#include "windows.h"
+#ifndef SIZEOF_HKEY
+/* used only here */
+#if defined(MS_WIN64)
+# define SIZEOF_HKEY 8
+#elif defined(MS_WIN32)
+# define SIZEOF_HKEY 4
+#else
+# error "SIZEOF_HKEY is not defined"
+#endif
+#endif
+
+#ifndef REG_LEGAL_CHANGE_FILTER
+#define REG_LEGAL_CHANGE_FILTER (\
+ REG_NOTIFY_CHANGE_NAME |\
+ REG_NOTIFY_CHANGE_ATTRIBUTES |\
+ REG_NOTIFY_CHANGE_LAST_SET |\
+ REG_NOTIFY_CHANGE_SECURITY )
+#endif
+
static BOOL PyHKEY_AsHKEY(PyObject *ob, HKEY *pRes, BOOL bNoneOK);
static BOOL clinic_HKEY_converter(PyObject *ob, void *p);
static PyObject *PyHKEY_FromHKEY(HKEY h);