Skip to content

Commit 972fe2f

Browse files
committed
move unix_epoch to time_zone.h to avoid jumbo/unity build failure
Signed-off-by: Steven Noonan <[email protected]>
1 parent fe95c92 commit 972fe2f

File tree

3 files changed

+8
-10
lines changed

3 files changed

+8
-10
lines changed

absl/time/format.cc

-5
Original file line numberDiff line numberDiff line change
@@ -44,11 +44,6 @@ struct cctz_parts {
4444
cctz::detail::femtoseconds fem;
4545
};
4646

47-
inline cctz::time_point<cctz::seconds> unix_epoch() {
48-
return std::chrono::time_point_cast<cctz::seconds>(
49-
std::chrono::system_clock::from_time_t(0));
50-
}
51-
5247
// Splits a Time into seconds and femtoseconds, which can be used with CCTZ.
5348
// Requires that 't' is finite. See duration.cc for details about rep_hi and
5449
// rep_lo.

absl/time/internal/cctz/include/cctz/time_zone.h

+8
Original file line numberDiff line numberDiff line change
@@ -454,6 +454,14 @@ inline bool join_seconds(const time_point<seconds>& sec, const femtoseconds&,
454454
} // namespace detail
455455
} // namespace cctz
456456
} // namespace time_internal
457+
458+
namespace {
459+
inline absl::time_internal::cctz::time_point<absl::time_internal::cctz::seconds> unix_epoch() {
460+
return std::chrono::time_point_cast<absl::time_internal::cctz::seconds>(
461+
std::chrono::system_clock::from_time_t(0));
462+
}
463+
} // namespace
464+
457465
ABSL_NAMESPACE_END
458466
} // namespace absl
459467

absl/time/time.cc

-5
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,6 @@ ABSL_NAMESPACE_BEGIN
5151

5252
namespace {
5353

54-
inline cctz::time_point<cctz::seconds> unix_epoch() {
55-
return std::chrono::time_point_cast<cctz::seconds>(
56-
std::chrono::system_clock::from_time_t(0));
57-
}
58-
5954
// Floors d to the next unit boundary closer to negative infinity.
6055
inline int64_t FloorToUnit(absl::Duration d, absl::Duration unit) {
6156
absl::Duration rem;

0 commit comments

Comments
 (0)