[libc++abi] Guard include of <unistd.h> behind __has_include

This doesn't change anything on platforms that have <unistd.h>, but
it will allow this file to compile on platforms that do not.
This commit is contained in:
Louis Dionne 2021-10-20 17:36:13 -04:00
parent 8e4ae603d6
commit ff5050a3a4
1 changed files with 3 additions and 1 deletions

View File

@ -39,11 +39,13 @@
#include "__cxxabi_config.h"
#include "include/atomic_support.h" // from libc++
#include <unistd.h>
#if defined(__has_include)
# if __has_include(<sys/syscall.h>)
# include <sys/syscall.h>
# endif
# if __has_include(<unistd.h>)
# include <unistd.h>
# endif
#endif
#include <stdlib.h>