From a4a13949a882484c4ab54c94fbbe58bf7b366a93 Mon Sep 17 00:00:00 2001 From: Lorn Potter Date: Thu, 19 Aug 2021 14:23:04 +1000 Subject: [PATCH] wasm: fix assert in QDateTime like windows, we dont have historical time data Change-Id: Iab77c1e2949bc909324f18209e6c52324c80a548 Reviewed-by: Edward Welbourne --- src/corelib/time/qdatetime.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/corelib/time/qdatetime.cpp b/src/corelib/time/qdatetime.cpp index aa14f4525e..61a1ca9273 100644 --- a/src/corelib/time/qdatetime.cpp +++ b/src/corelib/time/qdatetime.cpp @@ -2813,7 +2813,7 @@ static inline bool millisInSystemRange(qint64 millis, qint64 slack = 0) */ static int systemTimeYearMatching(int year) { -#ifdef Q_OS_WIN // Doesn't suppor times before epoch +#if defined(Q_OS_WIN) || defined(Q_OS_WASM)// They don't support times before the epoch static constexpr int forLeapEarly[] = { 1984, 1996, 1980, 1992, 1976, 1988, 1972 }; static constexpr int regularEarly[] = { 1978, 1973, 1974, 1975, 1970, 1971, 1977 }; #else // First year fully in 32-bit time_t range is 1902