Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(7)

Unified Diff: PC/winreg.c

Issue 3871: cross and native build of python for mingw32 with distutils
Patch Set: Created 7 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « PC/pyconfig.h ('k') | pyconfig.h.in » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/PC/winreg.c Thu Dec 27 23:52:36 2012 +0200
+++ b/PC/winreg.c Thu Dec 27 17:35:12 2012 -0500
@@ -16,6 +16,18 @@
#include "structmember.h"
#include "windows.h"
+#if defined(__MINGW32__)
+_CRTIMP size_t __cdecl __MINGW_NOTHROW _mbstrlen(const char *s);
+#endif
+
+#if !defined(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 PyObject *PyHKEY_FromHKEY(HKEY h);
static BOOL PyHKEY_Close(PyObject *obHandle);
@@ -1079,6 +1091,15 @@
static PyObject *
PyDeleteKeyEx(PyObject *self, PyObject *args, PyObject *kwargs)
{
+#ifndef KEY_WOW64_64KEY
+/* KEY_WOW64_64KEY is defined for _WIN32_WINNT >= 0x0502,
+ i.e. Windows Server 2003 with SP1, Windows XP with SP2
+ and not supported on w2k
+ */
+ PyErr_SetString(PyExc_NotImplementedError,
+ "not implemented on this platform");
+ return NULL;
+#else /*def KEY_WOW64_64KEY*/
HKEY hKey;
PyObject *key;
HMODULE hMod;
@@ -1115,6 +1136,7 @@
return PyErr_SetFromWindowsErrWithFunction(rc, "RegDeleteKeyEx");
Py_INCREF(Py_None);
return Py_None;
+#endif
}
static PyObject *
« no previous file with comments | « PC/pyconfig.h ('k') | pyconfig.h.in » ('j') | no next file with comments »

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+