diff options
author | Louis Dionne <ldionne.2@gmail.com> | 2021-10-21 00:36:13 +0300 |
---|---|---|
committer | Louis Dionne <ldionne.2@gmail.com> | 2021-10-21 00:37:19 +0300 |
commit | ff5050a3a4f2965aaddfce2f6b182476c11d78f3 (patch) | |
tree | 32139d9ceb923cc7d759483199176cfc326749ce /libcxxabi/src/cxa_guard_impl.h | |
parent | 8e4ae603d6ec7658df86302d122fb24968524164 (diff) |
[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.
Diffstat (limited to 'libcxxabi/src/cxa_guard_impl.h')
-rw-r--r-- | libcxxabi/src/cxa_guard_impl.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libcxxabi/src/cxa_guard_impl.h b/libcxxabi/src/cxa_guard_impl.h index 9d519bfc9f9f..e60e15a50fa1 100644 --- a/libcxxabi/src/cxa_guard_impl.h +++ b/libcxxabi/src/cxa_guard_impl.h @@ -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> |