diff --git a/include/boost/config/detail/suffix.hpp b/include/boost/config/detail/suffix.hpp index b8b37d0b4..2423c35d6 100644 --- a/include/boost/config/detail/suffix.hpp +++ b/include/boost/config/detail/suffix.hpp @@ -1202,7 +1202,7 @@ namespace std{ using ::type_info; } #endif #endif -#ifdef __has_include +#if defined(__cplusplus) && defined(__has_include) #if !__has_include() # define BOOST_NO_CXX20_HDR_VERSION #else diff --git a/include/boost/config/stdlib/libcpp.hpp b/include/boost/config/stdlib/libcpp.hpp index fc1d5bb4a..bc8536ead 100644 --- a/include/boost/config/stdlib/libcpp.hpp +++ b/include/boost/config/stdlib/libcpp.hpp @@ -104,7 +104,7 @@ # define BOOST_NO_CXX98_BINDERS #endif -#ifdef __has_include +#if defined(__cplusplus) && defined(__has_include) #if __has_include() #include