32 lines
1.1 KiB
Diff
32 lines
1.1 KiB
Diff
From a29def5abac001f987a6e21643a296bb6fea1bad Mon Sep 17 00:00:00 2001
|
|
From: Christoph Reiter <reiter.christoph@gmail.com>
|
|
Date: Fri, 5 Aug 2022 07:39:48 +0200
|
|
Subject: [PATCH 134/N] Avoid some macros only available in >Win7
|
|
|
|
They got added in 9041b00283737f77acbb for 3.10.6.
|
|
---
|
|
Modules/_winapi.c | 6 ++++++
|
|
1 file changed, 6 insertions(+)
|
|
|
|
diff --git a/Modules/_winapi.c b/Modules/_winapi.c
|
|
index 56f3306..c459157 100644
|
|
--- a/Modules/_winapi.c
|
|
+++ b/Modules/_winapi.c
|
|
@@ -1552,10 +1552,16 @@ _winapi_LCMapStringEx_impl(PyObject *module, PyObject *locale, DWORD flags,
|
|
PyObject *src)
|
|
/*[clinic end generated code: output=8ea4c9d85a4a1f23 input=2fa6ebc92591731b]*/
|
|
{
|
|
+#if WINVER >= 0x0602
|
|
if (flags & (LCMAP_SORTHANDLE | LCMAP_HASH | LCMAP_BYTEREV |
|
|
LCMAP_SORTKEY)) {
|
|
return PyErr_Format(PyExc_ValueError, "unsupported flags");
|
|
}
|
|
+#else
|
|
+ if (flags & (LCMAP_BYTEREV | LCMAP_SORTKEY)) {
|
|
+ return PyErr_Format(PyExc_ValueError, "unsupported flags");
|
|
+ }
|
|
+#endif
|
|
|
|
wchar_t *locale_ = PyUnicode_AsWideCharString(locale, NULL);
|
|
if (!locale_) {
|