Fix MinGW build to use Pthread when the header is available.
authorEric Fiselier <eric@efcs.ca>
Wed, 10 May 2017 21:34:58 +0000 (21:34 +0000)
committerEric Fiselier <eric@efcs.ca>
Wed, 10 May 2017 21:34:58 +0000 (21:34 +0000)
commita1bc823a59d5b6f310bdf6c7c7b62ec71b87d1aa
tree316e77eec695a4eb70286715c8e3898ffc88db2a
parent40a87a909b5c75099ff57ccf5da065f2cf6eea72
Fix MinGW build to use Pthread when the header is available.

Some MinGW configurations use WinPThread instead of the native
threading interfaces. When this happens libc++ doesn't build because
it tries to use the wrong threading API.

This patch attempts to correctly detect and enable pthreads; Selecting
them when __MINGW32__ is defined and __has_include(<pthread.h>) is true.
I'm not sure if this works correctly 100% of the time but it seemed
like the most correct approach available.

llvm-svn: 302734
libcxx/include/__config