Skip to content

Commit a6163be

Browse files
3405691582DougGregor
authored andcommitted
[concurrency] Provide missing header file. (#37004)
HAVE_PTHREAD_H is supplied in this config file. The `__has_include` pattern is discouraged, but there is no other way of conditioning on `pthread_np.h`, which is required for `pthread_main_np` on OpenBSD. Therefore, use it, but call it out in a comment. (cherry picked from commit eb945c8)
1 parent ba13f9d commit a6163be

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

stdlib/public/Concurrency/Actor.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@
3434
#include "swift/Runtime/ThreadLocalStorage.h"
3535
#include "swift/ABI/Task.h"
3636
#include "swift/ABI/Actor.h"
37+
#include "llvm/Config/config.h"
3738
#include "llvm/ADT/PointerIntPair.h"
3839
#include "TaskPrivate.h"
3940
#include "VoucherSupport.h"
@@ -61,6 +62,11 @@
6162

6263
#if HAVE_PTHREAD_H
6364
#include <pthread.h>
65+
66+
// Only use __has_include since HAVE_PTHREAD_NP_H is not provided.
67+
#if __has_include(<pthread_np.h>)
68+
#include <pthread_np.h>
69+
#endif
6470
#endif
6571

6672
#if defined(_WIN32)

0 commit comments

Comments
 (0)