]> sourceware.org Git - newlib-cygwin.git/commitdiff
Fix sys/time.h build problem due to inconsistent macro usage
authorCorinna Vinschen <corinna@vinschen.de>
Mon, 6 Jul 2015 12:08:30 +0000 (14:08 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 6 Jul 2015 12:08:30 +0000 (14:08 +0200)
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>
newlib/ChangeLog
newlib/libc/include/sys/time.h
newlib/libc/include/sys/types.h

index 9ada9de839f44ecd2ef01f686d8f4d134e3fe853..994f1ca0ef013a0a356ab7fdc14a26669d4b943e 100644 (file)
@@ -1,3 +1,9 @@
+2015-07-06  Corinna Vinschen  <corinna@vinschen.de>
+
+       * 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.
+
 2015-07-01  Sebastian Huber  <sebastian.huber@embedded-brains.de>
 
        * libc/stdio/fputs.c (_puts_r): Add missing CHECK_INIT().
index e95240e6069e582dfb487133ec08cd531ea7a208..7e7205bd832e2d5728470f15bd63d863d91f922f 100644 (file)
@@ -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>
index 9fe2f5de1543a0944fc110850a52c13817de144f..d8d6fdcb25afe2090f76f9ebc8e5971ae05557e9 100644 (file)
@@ -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;
This page took 0.052828 seconds and 5 git commands to generate.