From cd60c4c9f908abe5f420c44ef46863b51f0b86e8 Mon Sep 17 00:00:00 2001 From: Nick Thompson Date: Mon, 29 Oct 2018 08:52:20 -0600 Subject: [PATCH] [CI SKIP] Disable multiprecision in certain compilers. --- include/boost/integer/mod_inverse.hpp | 4 ++-- test/extended_euclidean_test.cpp | 9 +++++++-- test/mod_inverse_test.cpp | 8 +++++++- 3 files changed, 16 insertions(+), 5 deletions(-) diff --git a/include/boost/integer/mod_inverse.hpp b/include/boost/integer/mod_inverse.hpp index 7053efc..8836524 100644 --- a/include/boost/integer/mod_inverse.hpp +++ b/include/boost/integer/mod_inverse.hpp @@ -32,12 +32,12 @@ boost::optional mod_inverse(Z a, Z modulus) if (a == 0) { // a doesn't have a modular multiplicative inverse: - return {}; + return boost::none; } euclidean_result_t u = extended_euclidean(a, modulus); if (u.gcd > 1) { - return {}; + return boost::none; } // x might not be in the range 0 < x < m, let's fix that: while (u.x <= 0) diff --git a/test/extended_euclidean_test.cpp b/test/extended_euclidean_test.cpp index 45b9f02..ae7b866 100644 --- a/test/extended_euclidean_test.cpp +++ b/test/extended_euclidean_test.cpp @@ -4,8 +4,13 @@ * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -// A bug in gcc 4.8, not worth fixing, causes this to fail on gcc4.8. -#if __GNUC__ > 4 +#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || \ + (defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2)) || \ + (defined(BOOST_GCC) && defined(BOOST_GCC_CXX11) && BOOST_GCC < 40800) +#define DISABLE_MP_TESTS +#endif + +#ifndef DISABLE_MP_TESTS #include #include #include diff --git a/test/mod_inverse_test.cpp b/test/mod_inverse_test.cpp index 7367d15..bc29804 100644 --- a/test/mod_inverse_test.cpp +++ b/test/mod_inverse_test.cpp @@ -4,7 +4,13 @@ * Boost Software License, Version 1.0. (See accompanying file * LICENSE_1_0.txt or copy at http://www.boost.org/LICENSE_1_0.txt) */ -#if __GNUC__ > 4 +#if (defined(BOOST_MSVC) && (BOOST_MSVC < 1500)) || \ + (defined(__clang_major__) && (__clang_major__ == 3) && (__clang_minor__ < 2)) || \ + (defined(BOOST_GCC) && defined(BOOST_GCC_CXX11) && BOOST_GCC < 40800) +#define DISABLE_MP_TESTS +#endif + +#ifndef DISABLE_MP_TESTS #include #include #include