diff --git a/src/ossia/detail/jthread.hpp b/src/ossia/detail/jthread.hpp index ad8a63fe1d0..29e3648ad1c 100644 --- a/src/ossia/detail/jthread.hpp +++ b/src/ossia/detail/jthread.hpp @@ -1,6 +1,18 @@ #pragma once #include + #if __cpp_lib_jthread >= 201911L +#define OSSIA_HAS_STD_JTHREAD 1 + +#elif _LIBCPP_VERSION >= 18100 +#if defined(_LIBCPP_HAS_NO_EXPERIMENTAL_STOP_TOKEN) +#error Rebuild with -fexperimental-library, clang 18 ships headers which are incompatible with this file but hides half of them behind that flag +#else +#define OSSIA_HAS_STD_JTHREAD 1 +#endif +#endif + +#if OSSIA_HAS_STD_JTHREAD #include #include #else