build: Don't fix Y2038 problem with icu

This commit is contained in:
klzgrad 2020-11-18 22:51:53 +08:00
parent 2608c84ab1
commit 87cbc998e3
3 changed files with 6 additions and 2 deletions

View File

@ -2068,7 +2068,7 @@ component("base") {
if (is_posix && !is_apple) {
sources += [
"time/time_conversion_posix.cc",
"time/time_exploded_icu.cc", # See note below.
#"time/time_exploded_icu.cc", # See note below.
"time/time_exploded_posix.cc",
"time/time_now_posix.cc",
]
@ -2079,7 +2079,7 @@ component("base") {
# versa). Thus, the dependency is taken here for all POSIX platforms and the
# compiler+linker should be able to easily detect when the ICU routines will
# not be called and delete them in the final linking.
deps += [ "//third_party/icu:icui18n" ]
#deps += [ "//third_party/icu:icui18n" ]
}
if (is_posix && !is_apple && !is_nacl) {

View File

@ -789,6 +789,7 @@ class BASE_EXPORT Time : public time_internal::TimeBase<Time> {
// Some platforms use the ICU library to provide To/FromExploded, when their
// native library implementations are insufficient in some way.
#if 0
static void ExplodeUsingIcu(int64_t millis_since_unix_epoch,
bool is_local,
Exploded* exploded);
@ -796,6 +797,7 @@ class BASE_EXPORT Time : public time_internal::TimeBase<Time> {
const Exploded& exploded,
int64_t* millis_since_unix_epoch)
WARN_UNUSED_RESULT;
#endif
// Rounds down the time to the nearest day in either local time
// |is_local = true| or UTC |is_local = false|.

View File

@ -124,11 +124,13 @@ void Time::Explode(bool is_local, Exploded* exploded) const {
const int64_t millis_since_unix_epoch =
ToRoundedDownMillisecondsSinceUnixEpoch();
#if 0
// For systems with a Y2038 problem, use ICU as the Explode() implementation.
if (sizeof(SysTime) < 8) {
ExplodeUsingIcu(millis_since_unix_epoch, is_local, exploded);
return;
}
#endif
// Split the |millis_since_unix_epoch| into separate seconds and millisecond
// components because the platform calendar-explode operates at one-second