From 52ae8a3024c5e29d5fc132e97804770cd5635218 Mon Sep 17 00:00:00 2001 From: Matt Jacobson Date: Wed, 26 Oct 2022 04:31:45 -0400 Subject: [PATCH] swift-dependency-tool: avoid redefinition of ScalarTraits on FreeBSD On FreeBSD, `size_t` and `uint64_t` are both typedefs of `unsigned long`. --- tools/swift-dependency-tool/swift-dependency-tool.cpp | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/tools/swift-dependency-tool/swift-dependency-tool.cpp b/tools/swift-dependency-tool/swift-dependency-tool.cpp index c8c900bc472bf..6508bd594d46e 100644 --- a/tools/swift-dependency-tool/swift-dependency-tool.cpp +++ b/tools/swift-dependency-tool/swift-dependency-tool.cpp @@ -28,9 +28,9 @@ using namespace fine_grained_dependencies; // MARK: SourceFileDepGraph YAML reading & writing //============================================================================== -// This introduces a redefinition where ever std::is_same_t -// holds -#if !(defined(__linux__) || defined(_WIN64)) +// This introduces a redefinition wherever std::is_same_t +// holds. +#if !(defined(__linux__) || defined(_WIN64) || defined(__FreeBSD__)) LLVM_YAML_DECLARE_SCALAR_TRAITS(size_t, QuotingType::None) #endif LLVM_YAML_DECLARE_ENUM_TRAITS(swift::fine_grained_dependencies::NodeKind) @@ -88,8 +88,9 @@ LLVM_YAML_DECLARE_MAPPING_TRAITS( namespace llvm { namespace yaml { -// This introduces a redefinition for Linux. -#if !(defined(__linux__) || defined(_WIN64)) +// This introduces a redefinition wherever std::is_same_t +// holds. +#if !(defined(__linux__) || defined(_WIN64) || defined(__FreeBSD__)) void ScalarTraits::output(const size_t &Val, void *, raw_ostream &out) { out << Val; }