0016.patch (2379B)
1 From: Michael Froman <mfroman@mozilla.com> 2 Date: Mon, 21 Jul 2025 17:36:00 -0500 3 Subject: Bug 1978462 - cherry-pick upstream abseil-cpp commit 66945910. r?ng! 4 5 Fixes errors: 6 ERROR - /builds/worker/checkouts/gecko/third_party/abseil-cpp/absl/time/time.h:1873:12: error: call to non-'constexpr' function 'int64_t absl::operator/(absl::Duration, absl::Duration)' 7 ERROR - /builds/worker/checkouts/gecko/third_party/abseil-cpp/absl/time/time.h:1884:12: error: call to non-'constexpr' function 'int64_t absl::operator/(absl::Duration, absl::Duration)' 8 ERROR - /builds/worker/checkouts/gecko/third_party/abseil-cpp/absl/time/time.h:1895:12: error: call to non-'constexpr' function 'int64_t absl::operator/(absl::Duration, absl::Duration)' 9 Mercurial Revision: https://hg.mozilla.org/mozilla-central/rev/91f36c8e9be8622d9ac48245d0f61c0e03683a48 10 --- 11 abseil-cpp/absl/time/time.h | 9 ++++++--- 12 1 file changed, 6 insertions(+), 3 deletions(-) 13 14 diff --git a/abseil-cpp/absl/time/time.h b/abseil-cpp/absl/time/time.h 15 index db17a4cd40b..53bca90d156 100644 16 --- a/abseil-cpp/absl/time/time.h 17 +++ b/abseil-cpp/absl/time/time.h 18 @@ -1869,8 +1869,9 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Nanoseconds(Duration d) { 19 time_internal::GetRepHi(d) >> 33 == 0) { 20 return (time_internal::GetRepHi(d) * 1000 * 1000 * 1000) + 21 (time_internal::GetRepLo(d) / time_internal::kTicksPerNanosecond); 22 + } else { 23 + return d / Nanoseconds(1); 24 } 25 - return d / Nanoseconds(1); 26 } 27 28 ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Microseconds( 29 @@ -1880,8 +1881,9 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Microseconds( 30 return (time_internal::GetRepHi(d) * 1000 * 1000) + 31 (time_internal::GetRepLo(d) / 32 (time_internal::kTicksPerNanosecond * 1000)); 33 + } else { 34 + return d / Microseconds(1); 35 } 36 - return d / Microseconds(1); 37 } 38 39 ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Milliseconds( 40 @@ -1891,8 +1893,9 @@ ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Milliseconds( 41 return (time_internal::GetRepHi(d) * 1000) + 42 (time_internal::GetRepLo(d) / 43 (time_internal::kTicksPerNanosecond * 1000 * 1000)); 44 + } else { 45 + return d / Milliseconds(1); 46 } 47 - return d / Milliseconds(1); 48 } 49 50 ABSL_ATTRIBUTE_CONST_FUNCTION constexpr int64_t ToInt64Seconds(Duration d) {