diff --git a/date.h b/date.h index c527f56..f88e74c 100644 --- a/date.h +++ b/date.h @@ -3,7 +3,7 @@ // The MIT License (MIT) // -// Copyright (c) 2015 Howard Hinnant +// Copyright (c) 2015, 2016 Howard Hinnant // // Permission is hereby granted, free of charge, to any person obtaining a copy // of this software and associated documentation files (the "Software"), to deal @@ -989,6 +989,13 @@ ceil(const std::chrono::time_point& tp) return time_point{ceil(tp.time_since_epoch())}; } +#else // _MSC_FULL_VER < 190023918 + +using std::chrono::floor; +using std::chrono::ceil; +using std::chrono::round; +using std::chrono::abs; + #endif // _MSC_FULL_VER < 190023918 // trunc towards zero @@ -3578,7 +3585,8 @@ public: os << std::abs(t.sub_s_.count()) * scale::num / scale::den; #else // __cplusplus >= 201402 // inefficient sub-optimal run-time mess, but gets the job done - const unsigned long long cl10 = std::ceil(log10(Period::den)); + const unsigned long long cl10 = + static_cast(std::ceil(log10(Period::den))); const auto p10 = std::pow(10., cl10); os.width(cl10); os << static_cast(std::abs(t.sub_s_.count()) diff --git a/tz.h b/tz.h index db97ac3..46e6386 100644 --- a/tz.h +++ b/tz.h @@ -85,6 +85,10 @@ static_assert(HAS_REMOTE_API == 0 ? AUTO_DOWNLOAD == 0 : true, #include #include #include +#if LAZY_INIT +# include +# include +#endif namespace date { @@ -738,7 +742,7 @@ format(const std::locale& loc, std::string format, using namespace std; using namespace std::chrono; - for (auto i = 0; i < format.size(); ++i) + for (std::size_t i = 0; i < format.size(); ++i) { if (format[i] == '%' && i < format.size()-1) {