Skip to content

Commit

Permalink
Fix build error on Windows
Browse files Browse the repository at this point in the history
  • Loading branch information
electroly committed Feb 19, 2024
1 parent 0fd3783 commit 80a00c3
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/vm/date.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -60,11 +60,13 @@ std::unique_ptr<ZoneInfoSource> customZoneInfoSourceFactory(
return std::make_unique<StaticZoneInfoSource>(it->second);
}

// Abseil will look for this zone_info_source_factory symbol.
// Abseil will look for this zone_info_source_factory symbol. Their intention was that we would define our own "strong"
// zone_info_source_factory symbol that overrides their "weak" symbol, but they don't support doing so in MinGW which
// we need. Instead we will let them define the symbol and then write to it when we initialize the TZDB.
namespace absl {
namespace time_internal {
namespace cctz_extension {
ZoneInfoSourceFactory zone_info_source_factory = customZoneInfoSourceFactory;
extern ZoneInfoSourceFactory zone_info_source_factory;
} // namespace cctz_extension
} // namespace time_internal
} // namespace absl
Expand All @@ -81,6 +83,7 @@ namespace vm {

void initializeTzdb() {
if (!_isTzdbInitialized) {
absl::time_internal::cctz_extension::zone_info_source_factory = customZoneInfoSourceFactory;
shared::untar(kResourceTzdb, static_cast<size_t>(kResourceTzdb_len), addStaticZoneInfoFile);
_isTzdbInitialized = true;
}
Expand Down

0 comments on commit 80a00c3

Please sign in to comment.