Skip to content

Commit

Permalink
pythongh-96665: Fixes build break on older MSVC versions due to C++20…
Browse files Browse the repository at this point in the history
… features in argument clinic
  • Loading branch information
zooba committed Sep 7, 2022
1 parent 3e26de3 commit 9e4179b
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions PC/_wmimodule.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down

0 comments on commit 9e4179b

Please sign in to comment.