From f08209874e58d0adbb08bd1dba4f58ba63f571c5 Mon Sep 17 00:00:00 2001 From: "C.A.M. Gerlach" Date: Mon, 9 Jan 2023 11:48:24 -0600 Subject: [PATCH] gh-99191: Use correct check for MSVC C++ version support in _wmimodule.cpp (GH-100381) --- .../Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst | 2 ++ PC/_wmimodule.cpp | 6 +++--- 2 files changed, 5 insertions(+), 3 deletions(-) create mode 100644 Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst diff --git a/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst b/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst new file mode 100644 index 00000000000..57a95ab3ffc --- /dev/null +++ b/Misc/NEWS.d/next/Windows/2022-12-20-18-36-17.gh-issue-99191.0cfRja.rst @@ -0,0 +1,2 @@ +Use ``_MSVC_LANG >= 202002L`` instead of less-precise ``_MSC_VER >=1929`` +to more accurately test for C++20 support in :file:`PC/_wmimodule.cpp`. diff --git a/PC/_wmimodule.cpp b/PC/_wmimodule.cpp index de22049dd33..310aa86d94d 100644 --- a/PC/_wmimodule.cpp +++ b/PC/_wmimodule.cpp @@ -17,7 +17,7 @@ #include -#if _MSC_VER >= 1929 +#if _MSVC_LANG >= 202002L // We can use clinic directly when the C++ compiler supports C++20 #include "clinic/_wmimodule.cpp.h" #else @@ -96,9 +96,9 @@ _query_thread(LPVOID param) } if (SUCCEEDED(hr)) { hr = services->ExecQuery( - bstr_t("WQL"), + bstr_t("WQL"), bstrQuery, - WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, + WBEM_FLAG_FORWARD_ONLY | WBEM_FLAG_RETURN_IMMEDIATELY, NULL, &enumerator );