Skip to content

Commit 49b3876

Browse files
authored
Avoid #include-ing fcntl.h and sys/stat.h in Random.cpp when not available (swiftlang#41279)
1 parent c2581ae commit 49b3876

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

stdlib/public/stubs/Random.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,17 @@
2222
#include <Windows.h>
2323
#include <Bcrypt.h>
2424
#pragma comment(lib, "bcrypt.lib")
25-
#else
25+
#elif !defined(__APPLE__)
2626
#include <errno.h>
2727
#include <fcntl.h>
2828
#endif
2929

3030
#if __has_include(<sys/random.h>)
3131
#include <sys/random.h>
3232
#endif
33+
#if __has_include(<sys/stat.h>)
3334
#include <sys/stat.h>
35+
#endif
3436
#if __has_include(<sys/syscall.h>)
3537
#include <sys/syscall.h>
3638
#endif

0 commit comments

Comments
 (0)