Skip to content

Commit 3d5b6ce

Browse files
compnerddas
authored andcommitted
guard includes with checks
sys/cdefs.h and unistd.h are not always available. We already have checks for these, guard the inclusion appropriately. Signed-off-by: Daniel A. Steffen <dsteffen@apple.com>
1 parent 26d2dce commit 3d5b6ce

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

dispatch/dispatch.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,17 @@
3939
#endif
4040
#endif // __APPLE__
4141

42+
#if HAVE_SYS_CDEFS_H
4243
#include <sys/cdefs.h>
44+
#endif
4345
#include <sys/types.h>
4446
#include <stddef.h>
4547
#include <stdint.h>
4648
#include <stdbool.h>
4749
#include <stdarg.h>
50+
#if HAVE_UNISTD_H
4851
#include <unistd.h>
52+
#endif
4953
#include <fcntl.h>
5054

5155
#if defined(__linux__) && defined(__has_feature)

os/object_private.h

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,9 @@
2727
#ifndef __OS_OBJECT_PRIVATE__
2828
#define __OS_OBJECT_PRIVATE__
2929

30+
#if HAVE_SYS_CDEFS_H
3031
#include <sys/cdefs.h>
32+
#endif
3133
#include <stddef.h>
3234
#include <os/object.h>
3335

0 commit comments

Comments
 (0)