]> sourceware.org Git - newlib-cygwin.git/commitdiff
Avoid cyclic header dependencies
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Thu, 16 May 2019 12:40:32 +0000 (14:40 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 3 Jun 2019 08:20:15 +0000 (10:20 +0200)
RTEMS uses a considerable part of FreeBSD kernel and user space sources.
These sources are compiled with a __FreeBSD__ define.  On 2018-06-26
Gerald Pfeifer changed the GCC provided <stddef.h> so that it includes
<sys/_types.h> if __FreeBSD__ is defined.  The Newlib <sys/_types.h>
included <sys/lock.h> which includes <sys/cdefs.h> on RTEMS which
includes <stddef.h>.  To get rid of this cyclic dependency move the
optional _flock_t definition to <sys/reent.h>.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
newlib/libc/include/sys/_types.h
newlib/libc/include/sys/reent.h

index fc10531d5ca3c9e15edd9c5bd06ed233ac0e6412..90383b083ce1ede0bc172efd62e46c857bd80328 100644 (file)
@@ -22,7 +22,6 @@
 #include <newlib.h>
 #include <sys/config.h>
 #include <machine/_types.h>
-#include <sys/lock.h>
 
 #ifndef __machine_blkcnt_t_defined
 typedef long __blkcnt_t;
@@ -171,10 +170,6 @@ typedef struct
 } _mbstate_t;
 #endif
 
-#ifndef __machine_flock_t_defined
-typedef _LOCK_RECURSIVE_T _flock_t;
-#endif
-
 #ifndef __machine_iconv_t_defined
 /* Iconv descriptor type */
 typedef void *_iconv_t;
index 6e55e1c1fa760c4090a1f9cca8c9f83ae68065f9..7f8124deb8b4663fca4fabfd74efb1a1d4b643d4 100644 (file)
@@ -30,6 +30,11 @@ typedef unsigned __Long __ULong;
 #include <sys/types.h>
 #endif
 
+#ifndef __machine_flock_t_defined
+#include <sys/lock.h>
+typedef _LOCK_RECURSIVE_T _flock_t;
+#endif
+
 #ifndef __Long
 #define __Long __int32_t
 typedef __uint32_t __ULong;
This page took 0.038398 seconds and 5 git commands to generate.