From f4b12ab0233d5f31a915d52ac819eb88fcb5eb05 Mon Sep 17 00:00:00 2001 From: Tullio Menga Date: Mon, 20 Nov 2017 16:42:42 +0100 Subject: [PATCH] Adjust HAS_CHRONO_ROUNDING macro for MSVC with v140_clang_c2 and LLVM-vs2014 --- include/date/date.h | 2 +- src/tz.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/include/date/date.h b/include/date/date.h index c97936d..fc46816 100644 --- a/include/date/date.h +++ b/include/date/date.h @@ -1108,7 +1108,7 @@ trunc(const std::chrono::duration& d) } #ifndef HAS_CHRONO_ROUNDING -# if defined(_MSC_FULL_VER) && _MSC_FULL_VER >= 190023918 +# if defined(_MSC_FULL_VER) && (_MSC_FULL_VER >= 190023918 || (_MSC_FULL_VER >= 190000000 && defined (__clang__))) # define HAS_CHRONO_ROUNDING 1 # elif defined(__cpp_lib_chrono) && __cplusplus > 201402 && __cpp_lib_chrono >= 201510 # define HAS_CHRONO_ROUNDING 1 diff --git a/src/tz.cpp b/src/tz.cpp index 2fdc04c..4e09c86 100644 --- a/src/tz.cpp +++ b/src/tz.cpp @@ -2465,7 +2465,7 @@ time_zone::get_info_impl(sys_seconds tp, int tz_int) const using namespace date; tz timezone = static_cast(tz_int); assert(timezone != tz::standard); - auto y = year_month_day(date::floor(tp)).year(); + auto y = year_month_day(floor(tp)).year(); if (y < min_year || y > max_year) throw std::runtime_error("The year " + std::to_string(static_cast(y)) + " is out of range:[" + std::to_string(static_cast(min_year)) + ", "