This is the mail archive of the newlib-cvs@sourceware.org mailing list for the newlib project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[newlib-cygwin] Make sure to have full configuration info in sys/_types.h.


https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=72ded594471affbad3950f7a7a622304605be98f

commit 72ded594471affbad3950f7a7a622304605be98f
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Wed May 18 21:05:31 2016 +0200

    Make sure to have full configuration info in sys/_types.h.
    
    The following testcase:
    
      $ cat > test.c <<EOF
      #include <sys/select.h>
      #include <sys/time.h>
      EOF
      $ gcc -c test.c
    
    emits the following error:
    
      /usr/include/sys/reent.h:276:3: error: expected specifier-qualifier-list befor
    e â??_fpos64_tâ??
         _fpos64_t _EXFNPTR(_seek64, (struct _reent *, _PTR, _fpos64_t, int));
         ^
    
    The reason is that the load order from sys/select.h includes sys/_types.h
    before sys/config.h has been included from anywhere else.  sys/_types.h
    defines _fpos64_t only if __LARGE64_FILES is defined, but it never is in
    this scenario.  So sys/_types.h has to make sure to get the configuration
    info by itself.
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 newlib/libc/include/sys/_types.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/newlib/libc/include/sys/_types.h b/newlib/libc/include/sys/_types.h
index 355603d..4bf2bc4 100644
--- a/newlib/libc/include/sys/_types.h
+++ b/newlib/libc/include/sys/_types.h
@@ -19,6 +19,8 @@
 #ifndef	_SYS__TYPES_H
 #define _SYS__TYPES_H
 
+#include <newlib.h>
+#include <sys/config.h>
 #include <machine/_types.h>
 #include <sys/lock.h>


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]