freestanding
freestanding copied to clipboard
Include C++17 type_traits and C++20 chrono calendars
This PR and its sister PR in ogiroux/libcxx
encapsulate the changes necessary to use the C++17 type_traits
and C++20 chrono calendars in cudf with the -std=c++14
flag.
C++17 type_traits
https://github.com/ogiroux/freestanding/commit/25eb5eb32ddb91c76c8e35b4ef26f39e0c354c3b makes the following modifications:
- Defines
_LIBCPP_HAS_NO_IS_AGGREGATE
in__config
- Wraps
type_traits
include in block with_LIBCPP_STD_VER
redefined to 17
C++20 chrono calendars
This task was more involved, and I couldn't get it working without also modifying ogiroux/libcxx
.
- https://github.com/ogiroux/libcxx/commit/34b5d0ee7ef7fbc9815062e439e8ba37f140463e defines a new
_LIBCPP_INLINE_CONSTEXPR
macro to replace theinline constexpr
variable declarations withstatic constexpr
- https://github.com/ogiroux/libcxx/commit/3662fa54c924d07de23585e4fe7df406290e855a makes the private static
__ratio_multiply
and__ratio_divide
members public, which was the only solution I found to these compiler errors. Open to suggestions on a better fix here. - https://github.com/ogiroux/libcxx/commit/0c4ee1a92f3588f0bf65e2190e7017e1c2f9b4b1 comments out the
hh_mm_ss
implementation, which was the only solution I found to these compiler errors.- This
hh_mm_ss
impl looks different from the latest version inHowardHinnant/date
. IfHowardHinnant/date
is the C++20 reference impl, upgrading to the latest may be a solution.
- This
- https://github.com/ogiroux/freestanding/commit/ec493a541441315a10529831284786111eeb0715 and https://github.com/ogiroux/libcxx/commit/2afe936403008372a29e44ea37c36af187964d90 move the external
system_clock
intolibcxx
directly, because the subsequent types rely onsys_time
already being defined.- https://github.com/ogiroux/freestanding/commit/ec493a541441315a10529831284786111eeb0715 wraps
chrono
include in a block with_LIBCPP_STD_VER
redefined to 20, and undefines_LIBCPP_HAS_CLOCK_API_EXTERNAL
. - I attempted to avoid this with forward declarations for
time_point
, but couldn't get it to compile. This is probably the nastiest change, so I'm open to alternative fixes here too.
- https://github.com/ogiroux/freestanding/commit/ec493a541441315a10529831284786111eeb0715 wraps