|
25 | 25 |
|
26 | 26 | #include <cuda/std/__cccl/attributes.h> |
27 | 27 | #include <cuda/std/__cccl/extended_data_types.h> |
| 28 | +#include <cuda/std/__cccl/host_std_lib.h> |
28 | 29 |
|
29 | 30 | //! This file consolidates all compiler builtin detection for CCCL. |
30 | 31 | //! |
|
609 | 610 |
|
610 | 611 | // Some compilers provide std::move/std::forward/etc as builtins |
611 | 612 | #if defined(__cplusplus) |
612 | | -// Bring in the feature test macros (needed for std::forward_like) |
613 | | -# if _CCCL_HAS_INCLUDE(<version>) // <version> should be the smallest include possible |
614 | | -# include <version> |
615 | | -# elif !_CCCL_COMPILER(NVRTC) |
616 | | -# include <ciso646> // otherwise go for the smallest possible header |
617 | | -# endif // !_CCCL_COMPILER(NVRTC) |
618 | | - |
619 | 613 | // Bring in the bits of the STL we need |
620 | | -# if defined(_GLIBCXX_VERSION) |
| 614 | +# if _CCCL_HOST_STD_LIB(LIBSTDCXX) |
621 | 615 | # include <bits/move.h> // for move, forward, forward_like, and addressof |
622 | | -# elif defined(_LIBCPP_VERSION) |
| 616 | +# elif _CCCL_HOST_STD_LIB(LIBCXX) |
623 | 617 | # include <__memory/addressof.h> |
624 | 618 | # include <__utility/as_const.h> |
625 | 619 | # include <__utility/forward.h> |
626 | | -# include <__utility/forward_like.h> |
| 620 | +# if __cpp_lib_forward_like >= 202217L |
| 621 | +# include <__utility/forward_like.h> |
| 622 | +# endif // __cpp_lib_forward_like >= 202217L |
627 | 623 | # include <__utility/move.h> |
628 | 624 | # endif |
629 | 625 |
|
630 | | -# if defined(_GLIBCXX_VERSION) || defined(_LIBCPP_VERSION) |
| 626 | +# if _CCCL_HOST_STD_LIB(LIBSTDCXX) || _CCCL_HOST_STD_LIB(LIBCXX) |
631 | 627 | // std::move builtin |
632 | 628 | # if _CCCL_COMPILER(CLANG, >=, 15) || _CCCL_COMPILER(GCC, >=, 15) |
633 | 629 | # define _CCCL_HAS_BUILTIN_STD_MOVE() 1 |
|
650 | 646 |
|
651 | 647 | // std::forward_like builtin |
652 | 648 | // Leaving out MSVC for now because it is hard for forward-declare std::forward_like. |
653 | | -# if (_CCCL_COMPILER(CLANG, >=, 17) || _CCCL_COMPILER(GCC, >=, 15)) && defined(__cpp_lib_forward_like) \ |
654 | | - && (__cpp_lib_forward_like >= 202217L) |
| 649 | +# if (_CCCL_COMPILER(CLANG, >=, 17) || _CCCL_COMPILER(GCC, >=, 15)) && __cpp_lib_forward_like >= 202217L |
655 | 650 | # define _CCCL_HAS_BUILTIN_STD_FORWARD_LIKE() 1 |
656 | 651 | # endif |
657 | | -# endif // defined(_GLIBCXX_VERSION) || defined(_LIBCPP_VERSION) || defined(_MSVC_STL_VERSION) |
| 652 | +# endif // _CCCL_HOST_STD_LIB(LIBSTDCXX) || _CCCL_HOST_STD_LIB(LIBCXX) |
658 | 653 | #endif // defined(__cplusplus) |
659 | 654 |
|
660 | 655 | #ifndef _CCCL_HAS_BUILTIN_STD_MOVE |
|
0 commit comments