Adjust prefix path computations for base::Location Make locations relative to the root of our own source tree. --- base/location.cc | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/base/location.cc b/base/location.cc index b38ec16beabb..552e774edc7b 100644 --- a/base/location.cc +++ b/base/location.cc @@ -31,11 +31,15 @@ constexpr size_t StrLen(const char* str) { constexpr size_t StrippedFilePathPrefixLength() { constexpr char path[] = __FILE__; // Only keep the file path starting from the src directory. +#if defined(MOZ_ZUCCHINI) + constexpr char stripped[] = "third_party/zucchini/chromium/base/location.cc"; +#else #if defined(__clang__) && defined(_MSC_VER) constexpr char stripped[] = "base\\location.cc"; #else constexpr char stripped[] = "base/location.cc"; #endif +#endif // defined(MOZ_ZUCCHINI) constexpr size_t path_len = StrLen(path); constexpr size_t stripped_len = StrLen(stripped); static_assert(path_len >= stripped_len, @@ -63,6 +67,10 @@ constexpr bool StrEndsWith(const char* name, return true; } +#if defined(MOZ_ZUCCHINI) +static_assert(StrEndsWith(__FILE__, kStrippedPrefixLength, "third_party/zucchini/chromium/base/location.cc"), + "The file name does not match the expected prefix format."); +#else #if defined(__clang__) && defined(_MSC_VER) static_assert(StrEndsWith(__FILE__, kStrippedPrefixLength, "base\\location.cc"), "The file name does not match the expected prefix format."); @@ -70,6 +78,7 @@ static_assert(StrEndsWith(__FILE__, kStrippedPrefixLength, "base\\location.cc"), static_assert(StrEndsWith(__FILE__, kStrippedPrefixLength, "base/location.cc"), "The file name does not match the expected prefix format."); #endif +#endif // defined(MOZ_ZUCCHINI) } // namespace -- 2.42.0.windows.2