freestanding icon indicating copy to clipboard operation
freestanding copied to clipboard

Include C++17 type_traits and C++20 chrono calendars

Open trxcllnt opened this issue 4 years ago • 0 comments

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.

  1. https://github.com/ogiroux/libcxx/commit/34b5d0ee7ef7fbc9815062e439e8ba37f140463e defines a new _LIBCPP_INLINE_CONSTEXPR macro to replace the inline constexpr variable declarations with static constexpr
  2. 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.
  3. 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.
  4. https://github.com/ogiroux/freestanding/commit/ec493a541441315a10529831284786111eeb0715 and https://github.com/ogiroux/libcxx/commit/2afe936403008372a29e44ea37c36af187964d90 move the external system_clock into libcxx directly, because the subsequent types rely on sys_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.

trxcllnt avatar Oct 23 '19 19:10 trxcllnt