diff --git a/src/operations.cpp b/src/operations.cpp index 1b6278e71..8ef0443e6 100644 --- a/src/operations.cpp +++ b/src/operations.cpp @@ -77,11 +77,8 @@ # include # endif # ifdef __linux__ -# ifdef __GLIBC__ -# include -# if __GLIBC_PREREQ(2, 27) -# define BOOST_HAS_NATIVE_STATX 1 -# endif +# if defined(__GLIBC__) && defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 27) +# define BOOST_HAS_NATIVE_STATX 1 # endif # endif # include "limits.h" diff --git a/test/operations_test.cpp b/test/operations_test.cpp index f485632a9..c4913c5fb 100644 --- a/test/operations_test.cpp +++ b/test/operations_test.cpp @@ -50,10 +50,6 @@ using std::endl; #include #include // for system(), getenv(), etc. -#if defined(BOOST_POSIX_API) && defined(__linux__) -# include -#endif - #ifdef BOOST_WINDOWS_API # include @@ -1828,7 +1824,7 @@ namespace create_file(f1x, "foobar2"); # ifdef BOOST_POSIX_API -# if !(defined(__linux__) && __GLIBC_PREREQ(2, 27)) +# if !(defined(__linux__) && defined(__GLIBC__) && defined(__GLIBC_PREREQ) && __GLIBC_PREREQ(2, 27)) BOOST_TEST(CHECK_EXCEPTION([f1x]() -> void {fs::creation_time(f1x);}, BOOST_ERROR_NOT_SUPPORTED)); # endif # else