diff --git a/test/tz_test/validate.cpp b/test/tz_test/validate.cpp index 5a7ee08..44d9036 100644 --- a/test/tz_test/validate.cpp +++ b/test/tz_test/validate.cpp @@ -101,14 +101,14 @@ tzmain() { std::cout << name << '\n'; auto z = locate_zone(name); - auto begin = sys_days(jan/1/year::min()) + 0s; - auto end = sys_days(jan/1/2035) + 0s; + auto begin = sys_days(jan/1/year::min()) + seconds{0}; + auto end = sys_days(jan/1/2035) + seconds{0}; auto info = z->get_info(begin); std::cout << "Initially: "; - if (info.offset >= 0s) + if (info.offset >= seconds{0}) std::cout << '+'; std::cout << make_time(info.offset); - if (info.save == 0min) + if (info.save == minutes{0}) std::cout << " standard "; else std::cout << " daylight "; @@ -128,10 +128,10 @@ tzmain() auto ymd = year_month_day(dp); auto time = make_time(begin - dp); std::cout << ymd << ' ' << time << "Z "; - if (info.offset >= 0s) + if (info.offset >= seconds{0}) std::cout << '+'; std::cout << make_time(info.offset); - if (info.save == 0min) + if (info.save == minutes{0}) std::cout << " standard "; else std::cout << " daylight "; diff --git a/tz.cpp b/tz.cpp index b120bc3..21adb24 100644 --- a/tz.cpp +++ b/tz.cpp @@ -126,7 +126,7 @@ CONSTDATA auto max_day = date::dec/31; namespace detail { -class undocumented {explicit undocumented() = default;}; +struct undocumented {explicit undocumented() = default;}; } #ifndef _MSC_VER @@ -460,7 +460,6 @@ load_timezone_mappings_from_csv_file(const std::string& input_path) sis.clear(); sis.str(linebuf); - char ch; read_field_quote(); std::getline(sis, zm.other, '\"'); read_field_delim(); diff --git a/tz.h b/tz.h index 9b9e4b7..254a68d 100644 --- a/tz.h +++ b/tz.h @@ -95,6 +95,7 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true, # include # include #endif +#include namespace date { @@ -103,7 +104,7 @@ enum class choose {earliest, latest}; namespace detail { - class undocumented; + struct undocumented; } class nonexistent_local_time @@ -1431,10 +1432,10 @@ parse(std::basic_istream& is, f.get(is, 0, is, err, &tm, b, e); if ((err & ios_base::failbit) == 0) { -#ifndef _MSC_VER - auto tt = timegm(&tm); -#else +#if _WIN32 auto tt = _mkgmtime(&tm); +#else + auto tt = timegm(&tm); #endif tp = floor(system_clock::from_time_t(tt) + subseconds); abbrev = std::move(temp_abbrev);