Index: include/__threading_support =================================================================== --- include/__threading_support +++ include/__threading_support @@ -19,11 +19,18 @@ #ifndef _LIBCPP_HAS_NO_THREADS -#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) && (!defined(__has_include) || __has_include(<__external_threading>)) -#include <__external_threading> +// some versions of gcc does not like it when the following two #if conditions +// are combined into a single #if line, hence the redundancy. +#if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL) +# if !defined(__has_include) || __has_include(<__external_threading>) +# include <__external_threading> +# else +# include +# include +# endif #else -#include -#include +# include +# include #endif #if defined(_LIBCPP_HAS_THREAD_API_EXTERNAL)