Swift: add -Wno-pragma-once-outside-header to check

This commit is contained in:
Paolo Tranquilli
2023-01-10 14:30:35 +01:00
parent 28d79eeb77
commit 943763a026
2 changed files with 5 additions and 3 deletions

View File

@@ -18,7 +18,8 @@ genrule(
# see if https://cplusplus.github.io/LWG/issue3657 is fixed with the current compiler or not
# if fixed, PathHash.h.workaround will not compile
cmd = "\n".join([
"if $(CC) -c -x c++ -std=c++17 $(rootpath PathHash.h.workaround) -o /dev/null &> /dev/null; then",
"if $(CC) -c -x c++ -std=c++17 -Wno-pragma-once-outside-header \\",
" $(rootpath PathHash.h.workaround) -o /dev/null &> /dev/null; then",
" cp $(rootpath PathHash.h.workaround) $@",
"else",
" cp $(rootpath PathHash.h.fixed) $@",

View File

@@ -10,7 +10,8 @@
// std::variant would not kick in (we use std::filesystem::path in a variant used as a map key).
namespace std {
template <>
struct std::hash<std::filesystem::path> {
std::size_t operator()(const std::filesystem::path& path) const { return hash_value(path); }
struct hash<filesystem::path> {
size_t operator()(const filesystem::path& path) const { return hash_value(path); }
};
} // namespace std