Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCorinna Vinschen <corinna@vinschen.de>2015-07-06 15:08:30 +0300
committerCorinna Vinschen <corinna@vinschen.de>2015-07-06 15:08:30 +0300
commitf9b87aaf109366342777521fe93fe9f795e8f1fa (patch)
tree99cf5cbdccc48700b86abc3ef16beaea03c4d87e /newlib/libc
parent910087f70fb66c4949075811a0c23963c677dffa (diff)
Fix sys/time.h build problem due to inconsistent macro usage
https://sourceware.org/ml/newlib/2015/msg00520.html describes how sys/time.h uses __BSD_VISIBLE while the types used in the affected inline functions are guarded with !_POSIX_SOURCE. Fix that by guarding the type with __BSD_VISIBLE as well. * libc/include/sys/time.h: Explicitely include sys/cdefs.h. * libc/include/sys/types.h: Ditto. Guard BSD convenience base types with __BSD_VISIBLE rather than !_POSIX_SOURCE. Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
Diffstat (limited to 'newlib/libc')
-rw-r--r--newlib/libc/include/sys/time.h1
-rw-r--r--newlib/libc/include/sys/types.h5
2 files changed, 4 insertions, 2 deletions
diff --git a/newlib/libc/include/sys/time.h b/newlib/libc/include/sys/time.h
index e95240e60..7e7205bd8 100644
--- a/newlib/libc/include/sys/time.h
+++ b/newlib/libc/include/sys/time.h
@@ -38,6 +38,7 @@
#define _SYS_TIME_H_
#include <_ansi.h>
+#include <sys/cdefs.h>
#include <sys/_timeval.h>
#include <sys/types.h>
#include <sys/timespec.h>
diff --git a/newlib/libc/include/sys/types.h b/newlib/libc/include/sys/types.h
index 9fe2f5de1..d8d6fdcb2 100644
--- a/newlib/libc/include/sys/types.h
+++ b/newlib/libc/include/sys/types.h
@@ -18,6 +18,7 @@
#ifndef _SYS_TYPES_H
#include <_ansi.h>
+# include <sys/cdefs.h>
#ifndef __INTTYPES_DEFINED__
#define __INTTYPES_DEFINED__
@@ -83,7 +84,7 @@ typedef quad_t * qaddr_t;
#define _ST_INT32
#endif
-# ifndef _POSIX_SOURCE
+# if __BSD_VISIBLE
# define physadr physadr_t
# define quad quad_t
@@ -112,7 +113,7 @@ typedef unsigned long u_long;
typedef unsigned short ushort; /* System V compatibility */
typedef unsigned int uint; /* System V compatibility */
typedef unsigned long ulong; /* System V compatibility */
-# endif /*!_POSIX_SOURCE */
+# endif /*__BSD_VISIBLE */
#ifndef __clock_t_defined
typedef _CLOCK_T_ clock_t;