Always include <sys/cdefs.h>.
I made a mistake caught by code review earlier, so let's try to be
safer by default.
This patch also moves all our "forwarding" headers to the guardless
just-include-the-other-thing style that we usually use. (Where we
have a comment explaining where the header comes from, I've kept
that.)
Change-Id: I37342cf5e2563c6a269b2ba61a697069b1c7913b
diff --git a/libc/include/bits/posix_limits.h b/libc/include/bits/posix_limits.h
index 31016a8..0f17381 100644
--- a/libc/include/bits/posix_limits.h
+++ b/libc/include/bits/posix_limits.h
@@ -29,6 +29,7 @@
#ifndef _BITS_POSIX_LIMITS_H_
#define _BITS_POSIX_LIMITS_H_
+#include <sys/cdefs.h>
/* Any constant values here other than -1 or 200809L are explicitly specified by POSIX.1-2008. */
/* Keep it sorted. */
diff --git a/libc/include/bits/pthread_types.h b/libc/include/bits/pthread_types.h
index 6ac1c68..194a49b 100644
--- a/libc/include/bits/pthread_types.h
+++ b/libc/include/bits/pthread_types.h
@@ -29,6 +29,7 @@
#ifndef _BITS_PTHREAD_TYPES_H_
#define _BITS_PTHREAD_TYPES_H_
+#include <sys/cdefs.h>
#include <sys/types.h>
typedef long pthread_t;
diff --git a/libc/include/bits/sa_family_t.h b/libc/include/bits/sa_family_t.h
index 51ea51f..98ca27f 100644
--- a/libc/include/bits/sa_family_t.h
+++ b/libc/include/bits/sa_family_t.h
@@ -29,6 +29,8 @@
#ifndef _BITS_SA_FAMILY_T_H_
#define _BITS_SA_FAMILY_T_H_
+#include <sys/cdefs.h>
+
typedef unsigned short sa_family_t;
#endif
diff --git a/libc/include/bits/timespec.h b/libc/include/bits/timespec.h
index 046d898..df7a7ce 100644
--- a/libc/include/bits/timespec.h
+++ b/libc/include/bits/timespec.h
@@ -29,6 +29,7 @@
#ifndef _BITS_TIMESPEC_H_
#define _BITS_TIMESPEC_H_
+#include <sys/cdefs.h>
#include <sys/types.h>
/*
diff --git a/libc/include/bits/wchar_limits.h b/libc/include/bits/wchar_limits.h
index f779c1a..ffad604 100644
--- a/libc/include/bits/wchar_limits.h
+++ b/libc/include/bits/wchar_limits.h
@@ -29,6 +29,8 @@
#ifndef _BITS_WCHAR_LIMITS_H_
#define _BITS_WCHAR_LIMITS_H_
+#include <sys/cdefs.h>
+
/* Both GCC and clang define __WCHAR_MAX__. */
#define WCHAR_MAX __WCHAR_MAX__