Skip to content

Commit 9a48c87

Browse files
committed
Don't attempt to pull in <sys/cdefs.h> directly.
<sys/cdefs.h> is not a standard header. Instead, we'd better pull in a common header like <stdio.h>. It is very likely that such a header already provides the necessary bits.
1 parent f9fd21c commit 9a48c87

1 file changed

Lines changed: 5 additions & 10 deletions

File tree

include/cdefs-compat.h

Lines changed: 5 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
11
#ifndef _CDEFS_COMPAT_H_
22
#define _CDEFS_COMPAT_H_
33

4-
#ifndef _WIN32
5-
#include "sys/cdefs.h"
6-
#else /* _WIN32 */
4+
/*
5+
* We cannot be certain that this operating system has <sys/cdefs.h>.
6+
* Instead, include a header file that is likely to pull in this header.
7+
*/
8+
#include <stdio.h>
79

810
#if defined(__cplusplus)
911
#define __BEGIN_DECLS extern "C" {
@@ -13,13 +15,6 @@
1315
#define __END_DECLS
1416
#endif
1517

16-
#define _SYS_CDEFS_H_
17-
18-
#endif /* _WIN32 */
19-
20-
21-
22-
2318
#ifdef __GNUC__
2419
#ifndef __strong_reference
2520
#ifdef __APPLE__

0 commit comments

Comments
 (0)