From: Louis Dionne Date: Mon, 5 Oct 2020 20:39:33 +0000 (-0400) Subject: [libc++] Use __has_include instead of complex logic in thread.cpp X-Git-Tag: llvmorg-13-init~10069 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=477a68760b24f07a45253fb41e89368328b3a4a8;p=platform%2Fupstream%2Fllvm.git [libc++] Use __has_include instead of complex logic in thread.cpp We might end up including more headers than strictly necessary this way, but it's much simpler and it makes it easier to port thread.cpp to systems not handled by the existing conditionals. --- diff --git a/libcxx/src/thread.cpp b/libcxx/src/thread.cpp index 5f44e9e..e1dc972 100644 --- a/libcxx/src/thread.cpp +++ b/libcxx/src/thread.cpp @@ -14,17 +14,21 @@ #include "vector" #include "future" #include "limits" -#include -#if defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#if __has_include() +# include +#endif + +#if __has_include() # include -# if defined(__FreeBSD__) || defined(__NetBSD__) || defined(__OpenBSD__) || defined(__DragonFly__) || defined(__APPLE__) -# include -# endif -#endif // defined(__unix__) || (defined(__APPLE__) && defined(__MACH__)) +#endif + +#if __has_include() +# include +#endif #if __has_include() -#include +# include #endif #if defined(__NetBSD__)