Melissa Jost has submitted this change. (
https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email )
Change subject: base: Use <experimental/filesystem> include for GCC v7
......................................................................
base: Use <experimental/filesystem> include for GCC v7
This change adds include guards to the inclusion of the
filesystem module to ensure GCC 7 can work properly,
addressing an issue in the compiler tests.
Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3
Reviewed-on: https://gem5-review.googlesource.com/c/public/gem5/+/69840
Maintainer: Jason Lowe-Power <[email protected]>
Reviewed-by: Richard Cooper <[email protected]>
Tested-by: kokoro <[email protected]>
Reviewed-by: Jason Lowe-Power <[email protected]>
---
M src/mem/shared_memory_server.cc
1 file changed, 12 insertions(+), 1 deletion(-)
Approvals:
kokoro: Regressions pass
Jason Lowe-Power: Looks good to me, approved; Looks good to me, approved
Richard Cooper: Looks good to me, approved
diff --git a/src/mem/shared_memory_server.cc
b/src/mem/shared_memory_server.cc
index 3e49164..f99655c 100644
--- a/src/mem/shared_memory_server.cc
+++ b/src/mem/shared_memory_server.cc
@@ -39,7 +39,18 @@
#include <algorithm>
#include <cerrno>
#include <cstring>
-#include <filesystem>
+#if (defined(__GNUC__) && (__GNUC__ >= 8)) || defined(__clang__)
+ #include <filesystem>
+#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 <experimental/filesystem>.
+ #include <experimental/filesystem>
+ namespace std {
+ namespace filesystem = experimental::filesystem;
+ }
+#endif
#include "base/logging.hh"
#include "base/output.hh"
--
To view, visit
https://gem5-review.googlesource.com/c/public/gem5/+/69840?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gem5-review.googlesource.com/settings
Gerrit-MessageType: merged
Gerrit-Project: public/gem5
Gerrit-Branch: develop
Gerrit-Change-Id: I642f79bd801baf4766572368b9339e34be46d1c3
Gerrit-Change-Number: 69840
Gerrit-PatchSet: 2
Gerrit-Owner: Melissa Jost <[email protected]>
Gerrit-Reviewer: Bobby Bruce <[email protected]>
Gerrit-Reviewer: Daniel Carvalho <[email protected]>
Gerrit-Reviewer: Jason Lowe-Power <[email protected]>
Gerrit-Reviewer: Melissa Jost <[email protected]>
Gerrit-Reviewer: Richard Cooper <[email protected]>
Gerrit-Reviewer: kokoro <[email protected]>
Gerrit-CC: Giacomo Travaglini <[email protected]>
_______________________________________________
gem5-dev mailing list -- [email protected]
To unsubscribe send an email to [email protected]