瀏覽代碼

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.
Ed Schouten 10 年之前
父節點
當前提交
9a48c87386
共有 1 個文件被更改,包括 5 次插入10 次删除
  1. 5 10
      include/cdefs-compat.h

+ 5 - 10
include/cdefs-compat.h

@@ -1,9 +1,11 @@
 #ifndef _CDEFS_COMPAT_H_
 #ifndef _CDEFS_COMPAT_H_
 #define	_CDEFS_COMPAT_H_
 #define	_CDEFS_COMPAT_H_
 
 
-#ifndef _WIN32
-#include "sys/cdefs.h"
-#else /* _WIN32 */
+/*
+ * We cannot be certain that this operating system has <sys/cdefs.h>.
+ * Instead, include a header file that is likely to pull in this header.
+ */
+#include <stdio.h>
 
 
 #if defined(__cplusplus)
 #if defined(__cplusplus)
 #define	__BEGIN_DECLS	extern "C" {
 #define	__BEGIN_DECLS	extern "C" {
@@ -13,13 +15,6 @@
 #define	__END_DECLS
 #define	__END_DECLS
 #endif
 #endif
 
 
-#define _SYS_CDEFS_H_
-
-#endif /* _WIN32 */
-
-
-
-
 #ifdef __GNUC__
 #ifdef __GNUC__
 #ifndef __strong_reference
 #ifndef __strong_reference
 #ifdef __APPLE__
 #ifdef __APPLE__