mirror of
https://github.com/verilator/verilator.git
synced 2025-01-03 21:27:35 +00:00
parent
b42799f3b5
commit
444a4a760c
@ -29,30 +29,27 @@
|
|||||||
|
|
||||||
// clang-format off
|
// clang-format off
|
||||||
// Some preprocessor magic to support both Clang and GCC coroutines with both libc++ and libstdc++
|
// Some preprocessor magic to support both Clang and GCC coroutines with both libc++ and libstdc++
|
||||||
#ifdef __clang__
|
#if defined _LIBCPP_VERSION // libc++
|
||||||
# if __clang_major__ < 14
|
# if __clang_major__ > 13 // Clang > 13 warns that coroutine types in std::experimental are deprecated
|
||||||
# ifdef __GLIBCXX__ // Using stdlibc++
|
# pragma clang diagnostic push
|
||||||
# define __cpp_impl_coroutine 1 // Clang doesn't define this, but it's needed for libstdc++
|
# pragma clang diagnostic ignored "-Wdeprecated-experimental-coroutine"
|
||||||
# include <coroutine>
|
# endif
|
||||||
namespace std { // Bring coroutine library into std::experimental, as Clang < 14 expects it to be there
|
# include <experimental/coroutine>
|
||||||
namespace experimental {
|
namespace std {
|
||||||
using namespace std;
|
using namespace experimental; // Bring std::experimental into the std namespace
|
||||||
}
|
}
|
||||||
}
|
#else
|
||||||
# else // Using libc++
|
# if defined __clang__ && defined __GLIBCXX__
|
||||||
# include <experimental/coroutine> // Clang older than 14, coroutines are under experimental
|
# define __cpp_impl_coroutine 1 // Clang doesn't define this, but it's needed for libstdc++
|
||||||
namespace std {
|
|
||||||
using namespace experimental; // Bring std::experimental into the std namespace
|
|
||||||
}
|
|
||||||
# endif
|
|
||||||
# else // Clang >= 14
|
|
||||||
# if __GLIBCXX__ // Using stdlibc++
|
|
||||||
# define __cpp_impl_coroutine 1 // Clang doesn't define this, but it's needed for libstdc++
|
|
||||||
# endif
|
|
||||||
# include <coroutine>
|
|
||||||
# endif
|
# endif
|
||||||
#else // Not Clang
|
|
||||||
# include <coroutine>
|
# include <coroutine>
|
||||||
|
# if __clang_major__ < 14
|
||||||
|
namespace std { // Bring coroutine library into std::experimental, as Clang < 14 expects it to be there
|
||||||
|
namespace experimental {
|
||||||
|
using namespace std;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
# endif
|
||||||
#endif
|
#endif
|
||||||
// clang-format on
|
// clang-format on
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user