From 8769b6718175f50e69ae13c2b0b157a5eace1580 Mon Sep 17 00:00:00 2001 From: Matt Borland Date: Tue, 22 Feb 2022 17:41:14 +0100 Subject: [PATCH] Fix for issue #764 --- config/Jamfile.v2 | 2 ++ config/is_MSVC1930_or_newer.cpp | 16 ++++++++++++++++ test/Jamfile.v2 | 2 ++ 3 files changed, 20 insertions(+) create mode 100644 config/is_MSVC1930_or_newer.cpp diff --git a/config/Jamfile.v2 b/config/Jamfile.v2 index 77aca7c2e3..1cbfcda93b 100644 --- a/config/Jamfile.v2 +++ b/config/Jamfile.v2 @@ -36,6 +36,7 @@ obj has_gmp : has_gmp.cpp : obj is_ci_sanitizer_run : is_ci_sanitizer_run.cpp ; obj is_ci_standalone_run : is_ci_standalone_run.cpp ; obj is_cygwin_run : is_cygwin_run.cpp ; +obj is_MSVC1930_or_newer_run : is_MSVC1930_or_newer.cpp ; explicit has_long_double_support ; explicit has_mpfr_class ; @@ -52,3 +53,4 @@ explicit has_fftw3 ; explicit is_ci_sanitizer_run ; explicit is_ci_standalone_run ; explicit is_cygwin_run ; +explicit is_MSVC1930_or_newer_run ; diff --git a/config/is_MSVC1930_or_newer.cpp b/config/is_MSVC1930_or_newer.cpp new file mode 100644 index 0000000000..3c0d77a301 --- /dev/null +++ b/config/is_MSVC1930_or_newer.cpp @@ -0,0 +1,16 @@ +// Copyright Matt Borland 2022. +// Use, modification and distribution are subject to the +// Boost Software License, Version 1.0. (See accompanying file +// LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) +// +// The following change was released in VS 2022 17.1 Preview 1 and no longer allows compilation of *.c files +// https://github.com/microsoft/STL/pull/2148 + +#if !defined(_MSC_VER) || (_MSC_VER < 1930) +# error "MSVC1930 or newer run is NOT in effect". +#endif + +int main() +{ + return 0; +} diff --git a/test/Jamfile.v2 b/test/Jamfile.v2 index d4a75556db..3ce0c4ade8 100644 --- a/test/Jamfile.v2 +++ b/test/Jamfile.v2 @@ -933,6 +933,7 @@ test-suite misc : ../build//boost_math_c99f ../../test/build//boost_unit_test_framework : : : #requirements + [ check-target-builds ../config//is_MSVC1930_or_newer_run "MSVC1930 or newer run" : no ] : test_tr1_c ] @@ -944,6 +945,7 @@ test-suite misc : : : : TEST_LD=1 [ check-target-builds ../config//has_long_double_support "long double support" : : no ] + [ check-target-builds ../config//is_MSVC1930_or_newer_run "MSVC1930 or newer run" : no ] : test_tr1_c_long_double ]