diff --git a/src/base/socket.cc b/src/base/socket.cc index 62f20717f4..06fc28631f 100644 --- a/src/base/socket.cc +++ b/src/base/socket.cc @@ -40,13 +40,16 @@ #include -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) +// check if filesystem library is available +#if defined(__cpp_lib_filesystem) || __has_include() #include #else - // This is only reachable if we're using GCC 7 (note: gem5 does not support - // GCC versions older than GCC 7 as they do not support the C++17 - // standard). - // If we're using GCC 7, we need to use . + // This is only reachable if we're using GCC 7 or clang versions 6 + // through 10 (note: gem5 does not support GCC versions older than + // GCC 7 or clang versions older than clang 6.0 as they do not + // support the C++17 standard). + // If we're using GCC 7 or clang versions 6 through 10, we need to use + // . #include namespace std { namespace filesystem = experimental::filesystem; diff --git a/src/mem/shared_memory_server.cc b/src/mem/shared_memory_server.cc index f99655c475..a4305d0e11 100644 --- a/src/mem/shared_memory_server.cc +++ b/src/mem/shared_memory_server.cc @@ -39,13 +39,17 @@ #include #include #include -#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__) + +// check if filesystem library is available +#if defined(__cpp_lib_filesystem) || __has_include() #include #else - // This is only reachable if we're using GCC 7 (note: gem5 does not support - // GCC versions older than GCC 7 as they do not support the C++17 - // standard). - // If we're using GCC 7, we need to use . + // This is only reachable if we're using GCC 7 or clang versions 6 + // through 10 (note: gem5 does not support GCC versions older than + // GCC 7 or clang versions older than clang 6.0 as they do not + // support the C++17 standard). + // If we're using GCC 7 or clang versions 6 through 10, we need to use + // . #include namespace std { namespace filesystem = experimental::filesystem;