From 3f8db35232dc2f2fd0dc3b5f803d2f9a6a0d42b5 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 18 Nov 2021 08:38:50 -0500 Subject: [PATCH 1/4] ci: try newer images --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index dcc61ecd74..74a614d28d 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,7 +23,7 @@ jobs: strategy: fail-fast: false matrix: - runs-on: [ubuntu-latest, windows-latest, macos-latest] + runs-on: [ubuntu-latest, windows-2022, macos-11] python: - '2.7' - '3.5' From d0fc077d88ec868569f7d96914dfe4321935fde7 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 18 Nov 2021 08:57:11 -0500 Subject: [PATCH 2/4] fix: link to corecrt on MSVC 2022 --- include/pybind11/pybind11.h | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index cfe03f6dbd..c603a4b247 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -32,6 +32,11 @@ # define PYBIND11_STD_LAUNDER # define PYBIND11_HAS_STD_LAUNDER 0 #endif + +#if defined(_MSC_VER) && (_MSC_VER >= 1930) +#include +#endif + #if defined(__GNUG__) && !defined(__clang__) # include #endif From 317cf0feafe8e80e3efce10e7c903de6d8a60a11 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 18 Nov 2021 09:29:46 -0500 Subject: [PATCH 3/4] Update pybind11.h --- include/pybind11/pybind11.h | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index c603a4b247..5d861546f3 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -10,6 +10,11 @@ #pragma once +// Bug in MSVC 2022 requiring this file first +#if defined(_MSC_VER) && (_MSC_VER >= 1930) +#include +#endif + #include "attr.h" #include "gil.h" #include "options.h" @@ -33,10 +38,6 @@ # define PYBIND11_HAS_STD_LAUNDER 0 #endif -#if defined(_MSC_VER) && (_MSC_VER >= 1930) -#include -#endif - #if defined(__GNUG__) && !defined(__clang__) # include #endif From d8c30a8f2df87007ca2a5679119af50aff5c0695 Mon Sep 17 00:00:00 2001 From: Henry Schreiner Date: Thu, 18 Nov 2021 09:56:35 -0500 Subject: [PATCH 4/4] fix: drop _DEBUG undefinition --- include/pybind11/detail/common.h | 4 ---- include/pybind11/pybind11.h | 5 ----- 2 files changed, 9 deletions(-) diff --git a/include/pybind11/detail/common.h b/include/pybind11/detail/common.h index 862451fd13..5d9162b880 100644 --- a/include/pybind11/detail/common.h +++ b/include/pybind11/detail/common.h @@ -153,10 +153,6 @@ # pragma warning(push) // C4505: 'PySlice_GetIndicesEx': unreferenced local function has been removed (PyPy only) # pragma warning(disable: 4505) -# if defined(_DEBUG) && !defined(Py_DEBUG) -# define PYBIND11_DEBUG_MARKER -# undef _DEBUG -# endif #endif // https://en.cppreference.com/w/c/chrono/localtime diff --git a/include/pybind11/pybind11.h b/include/pybind11/pybind11.h index 5d861546f3..c0f074137e 100644 --- a/include/pybind11/pybind11.h +++ b/include/pybind11/pybind11.h @@ -10,11 +10,6 @@ #pragma once -// Bug in MSVC 2022 requiring this file first -#if defined(_MSC_VER) && (_MSC_VER >= 1930) -#include -#endif - #include "attr.h" #include "gil.h" #include "options.h"