Skip to content

Commit c86aa48

Browse files
authored
Explicitly #include <errno.h>, avoid depending on implicit inclusion by other headers (#66060)
1 parent e5f749b commit c86aa48

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

include/swift/Threading/Impl/Darwin.h

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,12 @@
2121
#include <os/lock.h>
2222
#include <pthread.h>
2323

24+
#if __has_include(<sys/errno.h>)
25+
#include <sys/errno.h>
26+
#else
27+
#include <errno.h>
28+
#endif
29+
2430
#include "chrono_utils.h"
2531

2632
#include "llvm/ADT/Optional.h"

stdlib/public/CommandLineSupport/CommandLine.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,12 @@
2424
#include <cstring>
2525
#include <string>
2626

27+
#if __has_include(<sys/errno.h>)
28+
#include <sys/errno.h>
29+
#else
30+
#include <errno.h>
31+
#endif
32+
2733
#include "swift/Runtime/Debug.h"
2834
#include "swift/Runtime/Win32.h"
2935

0 commit comments

Comments
 (0)