Merge branch 'gmcode_gmchanges'

This commit is contained in:
Howard Hinnant
2016-06-04 13:40:33 -04:00
3 changed files with 12 additions and 12 deletions

View File

@@ -101,14 +101,14 @@ tzmain()
{ {
std::cout << name << '\n'; std::cout << name << '\n';
auto z = locate_zone(name); auto z = locate_zone(name);
auto begin = sys_days(jan/1/year::min()) + 0s; auto begin = sys_days(jan/1/year::min()) + seconds{0};
auto end = sys_days(jan/1/2035) + 0s; auto end = sys_days(jan/1/2035) + seconds{0};
auto info = z->get_info(begin); auto info = z->get_info(begin);
std::cout << "Initially: "; std::cout << "Initially: ";
if (info.offset >= 0s) if (info.offset >= seconds{0})
std::cout << '+'; std::cout << '+';
std::cout << make_time(info.offset); std::cout << make_time(info.offset);
if (info.save == 0min) if (info.save == minutes{0})
std::cout << " standard "; std::cout << " standard ";
else else
std::cout << " daylight "; std::cout << " daylight ";
@@ -128,10 +128,10 @@ tzmain()
auto ymd = year_month_day(dp); auto ymd = year_month_day(dp);
auto time = make_time(begin - dp); auto time = make_time(begin - dp);
std::cout << ymd << ' ' << time << "Z "; std::cout << ymd << ' ' << time << "Z ";
if (info.offset >= 0s) if (info.offset >= seconds{0})
std::cout << '+'; std::cout << '+';
std::cout << make_time(info.offset); std::cout << make_time(info.offset);
if (info.save == 0min) if (info.save == minutes{0})
std::cout << " standard "; std::cout << " standard ";
else else
std::cout << " daylight "; std::cout << " daylight ";

3
tz.cpp
View File

@@ -126,7 +126,7 @@ CONSTDATA auto max_day = date::dec/31;
namespace detail namespace detail
{ {
class undocumented {explicit undocumented() = default;}; struct undocumented {explicit undocumented() = default;};
} }
#ifndef _MSC_VER #ifndef _MSC_VER
@@ -460,7 +460,6 @@ load_timezone_mappings_from_csv_file(const std::string& input_path)
sis.clear(); sis.clear();
sis.str(linebuf); sis.str(linebuf);
char ch;
read_field_quote(); read_field_quote();
std::getline(sis, zm.other, '\"'); std::getline(sis, zm.other, '\"');
read_field_delim(); read_field_delim();

9
tz.h
View File

@@ -95,6 +95,7 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true,
# include <memory> # include <memory>
# include <mutex> # include <mutex>
#endif #endif
#include <time.h>
namespace date namespace date
{ {
@@ -103,7 +104,7 @@ enum class choose {earliest, latest};
namespace detail namespace detail
{ {
class undocumented; struct undocumented;
} }
class nonexistent_local_time class nonexistent_local_time
@@ -1431,10 +1432,10 @@ parse(std::basic_istream<CharT, Traits>& is,
f.get(is, 0, is, err, &tm, b, e); f.get(is, 0, is, err, &tm, b, e);
if ((err & ios_base::failbit) == 0) if ((err & ios_base::failbit) == 0)
{ {
#ifndef _MSC_VER #if _WIN32
auto tt = timegm(&tm);
#else
auto tt = _mkgmtime(&tm); auto tt = _mkgmtime(&tm);
#else
auto tt = timegm(&tm);
#endif #endif
tp = floor<Duration>(system_clock::from_time_t(tt) + subseconds); tp = floor<Duration>(system_clock::from_time_t(tt) + subseconds);
abbrev = std::move(temp_abbrev); abbrev = std::move(temp_abbrev);