Skip to content

Commit

Permalink
Rework how we handle feature test macros
Browse files Browse the repository at this point in the history
We do not want to conflict with the host standard library but also provide users with feature test macros
  • Loading branch information
miscco committed Jul 11, 2023
1 parent a2d5000 commit ca13caf
Show file tree
Hide file tree
Showing 6 changed files with 489 additions and 264 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,9 @@
TEST_NV_DIAG_SUPPRESS(cuda_demote_unsupported_floating_point)

// NVRTC doesn't include host atomic making this feature test invalid
// TODO: Should we define __cpp_lib_atomic_is_always_lock_free for NVRTC?
#if !defined(__CUDACC_RTC__)
#if !defined(__cpp_lib_atomic_is_always_lock_free)
// TODO: Should we define __cccl_lib_atomic_is_always_lock_free for NVRTC?
#if !defined(_LIBCUDACXX_COMPILER_NVRTC)
#if !defined(__cccl_lib_atomic_is_always_lock_free)
# error Feature test macro missing.
#endif
#endif
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,14 +17,13 @@

#include "test_macros.h"

// libcudacxx does not have feature test macros... yet
/*
#ifndef __cpp_lib_is_constant_evaluated
#if TEST_STD_VER > 17
#ifndef __cccl_lib_is_constant_evaluated
#if TEST_HAS_BUILTIN(__builtin_is_constant_evaluated)
# error __cpp_lib_is_constant_evaluated should be defined
# error __cccl_lib_is_constant_evaluated should be defined
#endif
#endif
*/
#endif // __cccl_lib_is_constant_evaluated
#endif // TEST_STD_VER > 17

template <bool> struct InTemplate {};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ int main(int, char**)
test_is_integral<signed char>();
test_is_integral<unsigned char>();
test_is_integral<wchar_t>();
#if defined(__cpp_lib_char8_t) && __cpp_lib_char8_t >= 201811L
#if defined(__cccl_lib_char8_t) && __cccl_lib_char8_t >= 201811L
test_is_integral<char8_t>();
#endif

Expand Down
Loading

0 comments on commit ca13caf

Please sign in to comment.