Skip to content

Commit 9267c0a

Browse files
committed
Improve check for incomplete <execution> header
All versions of libc++ currently include a useless <execution> header by default, not just the version shipped with Apple Clang. For example, IBM Open XL C/C++ 17.1.3 on AIX is affected as well.
1 parent 9eba9d7 commit 9267c0a

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

include/boost/math/tools/config.hpp

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,8 @@
8484

8585
#else // Things from boost/config that are required, and easy to replicate
8686

87+
#include <version>
88+
8789
#define BOOST_MATH_PREVENT_MACRO_SUBSTITUTION
8890
#define BOOST_MATH_NO_REAL_CONCEPT_TESTS
8991
#define BOOST_MATH_NO_DISTRIBUTION_CONCEPT_TESTS
@@ -102,9 +104,9 @@
102104
#if ((__cplusplus > 201700L) || (defined(_MSVC_LANG) && (_MSVC_LANG > 201700L)))
103105
#define BOOST_MATH_IF_CONSTEXPR if constexpr
104106

105-
// Clang on mac provides the execution header with none of the functionality. TODO: Check back on this
107+
// libc++ currently provides the execution header with none of the functionality.
106108
// https://en.cppreference.com/w/cpp/compiler_support "Standardization of Parallelism TS"
107-
# if !__has_include(<execution>) || (defined(__APPLE__) && defined(__clang__))
109+
# if !__has_include(<execution>) || !defined(__cpp_lib_execution) || (__cpp_lib_execution < 201603L)
108110
# define BOOST_MATH_NO_CXX17_HDR_EXECUTION
109111
# endif
110112
#else

0 commit comments

Comments
 (0)