summaryrefslogtreecommitdiffstats
path: root/PC
diff options
context:
space:
mode:
authorSteve Dower <steve.dower@python.org>2022-09-07 21:53:33 (GMT)
committerGitHub <noreply@github.com>2022-09-07 21:53:33 (GMT)
commitb65686c50563c5f64b4eb6e684807c6ab6089523 (patch)
tree53050b56feed635bb39c633427d756996bb6356b /PC
parent8bc356a7dd50cbdb46d10b8c7e457832431f5d9e (diff)
downloadcpython-b65686c50563c5f64b4eb6e684807c6ab6089523.zip
cpython-b65686c50563c5f64b4eb6e684807c6ab6089523.tar.gz
cpython-b65686c50563c5f64b4eb6e684807c6ab6089523.tar.bz2
gh-96665: Fixes build break on older MSVC versions due to C++20 features in argument clinic (GH-96667)
Diffstat (limited to 'PC')
-rw-r--r--PC/_wmimodule.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp
index a9f7836..fbaadcc 100644
--- a/PC/_wmimodule.cpp
+++ b/PC/_wmimodule.cpp
@@ -15,7 +15,17 @@
#include <propvarutil.h>
#include <Python.h>
+
+
+#if _MSC_VER >= 1929
+// We can use clinic directly when the C++ compiler supports C++20
#include "clinic/_wmimodule.cpp.h"
+#else
+// Cannot use clinic because of missing C++20 support, so create a simpler
+// API instead. This won't impact releases, so fine to omit the docstring.
+static PyObject *_wmi_exec_query_impl(PyObject *module, PyObject *query);
+#define _WMI_EXEC_QUERY_METHODDEF {"exec_query", _wmi_exec_query_impl, METH_O, NULL},
+#endif
/*[clinic input]