]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-96665: Fixes build break on older MSVC versions due to C++20 features in argument...
authorSteve Dower <steve.dower@python.org>
Wed, 7 Sep 2022 21:53:33 +0000 (22:53 +0100)
committerGitHub <noreply@github.com>
Wed, 7 Sep 2022 21:53:33 +0000 (22:53 +0100)
PC/_wmimodule.cpp

index a9f7836172ba2c8dbadc20f92253365b20950dd3..fbaadcc511009069c56006457d3ece54dc7b2054 100644 (file)
 #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]