Skip to content

Commit ecf3338

Browse files
committed
winreg: patch cleanup
* REG_LEGAL_CHANGE_FILTER is part of mingw-w64 now * SIZEOF_HKEY is defined already * use the same build logic as with other win32 only modules Needs to be merged into "Build winreg by default when compiling for MINGW" Fixes #181
1 parent 7dce92d commit ecf3338

File tree

3 files changed

+2
-27
lines changed

3 files changed

+2
-27
lines changed

Modules/Setup.bootstrap.in

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,6 @@ _symtable symtablemodule.c
3636
@MODULE_PWD_TRUE@pwd pwdmodule.c
3737

3838
# build-in modules for windows platform:
39-
@USE_WIN32_MODULE@winreg ../PC/winreg.c
39+
@MODULE_WINREG_TRUE@winreg ../PC/winreg.c
4040
@MODULE_MSVCRT_TRUE@msvcrt -DPy_BUILD_CORE ../PC/msvcrtmodule.c
4141
@MODULE__WINAPI_TRUE@_winapi _winapi.c

PC/winreg.c

Lines changed: 0 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -19,25 +19,6 @@
1919
#include "structmember.h" // PyMemberDef
2020
#include <windows.h>
2121

22-
#ifndef SIZEOF_HKEY
23-
/* used only here */
24-
#if defined(MS_WIN64)
25-
# define SIZEOF_HKEY 8
26-
#elif defined(MS_WIN32)
27-
# define SIZEOF_HKEY 4
28-
#else
29-
# error "SIZEOF_HKEY is not defined"
30-
#endif
31-
#endif
32-
33-
#ifndef REG_LEGAL_CHANGE_FILTER
34-
#define REG_LEGAL_CHANGE_FILTER (\
35-
REG_NOTIFY_CHANGE_NAME |\
36-
REG_NOTIFY_CHANGE_ATTRIBUTES |\
37-
REG_NOTIFY_CHANGE_LAST_SET |\
38-
REG_NOTIFY_CHANGE_SECURITY )
39-
#endif
40-
4122
#if defined(MS_WINDOWS_DESKTOP) || defined(MS_WINDOWS_SYSTEM) || defined(MS_WINDOWS_GAMES)
4223

4324
typedef struct {

configure.ac

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -4633,13 +4633,6 @@ case $host in
46334633
CFLAGS_NODIST="$CFLAGS_NODIST -D_WIN32_WINNT=0x0602";;
46344634
esac
46354635

4636-
# Determine if windows modules should be used.
4637-
AC_SUBST(USE_WIN32_MODULE)
4638-
USE_WIN32_MODULE='#'
4639-
case $host in
4640-
*-*-mingw*) USE_WIN32_MODULE=;;
4641-
esac
4642-
46434636
# Templates for things AC_DEFINEd more than once.
46444637
# For a single AC_DEFINE, no template is needed.
46454638
AH_TEMPLATE([_REENTRANT],
@@ -8059,6 +8052,7 @@ PY_STDLIB_MOD([_hashlib], [], [test "$ac_cv_working_openssl_hashlib" = yes],
80598052
[$OPENSSL_INCLUDES], [$OPENSSL_LDFLAGS $OPENSSL_LDFLAGS_RPATH $LIBCRYPTO_LIBS])
80608053

80618054
dnl windows specific modules
8055+
PY_STDLIB_MOD([winreg], [test "$MACHDEP" = "win32"])
80628056
PY_STDLIB_MOD([msvcrt], [test "$MACHDEP" = "win32"])
80638057
PY_STDLIB_MOD([_winapi], [test "$MACHDEP" = "win32"])
80648058
PY_STDLIB_MOD([_msi], [test "$MACHDEP" = "win32"], [], [],

0 commit comments

Comments
 (0)