]> sourceware.org Git - newlib-cygwin.git/commit
Eliminate use of Newlib-specific <machine/types.h>
authorSebastian Huber <sebastian.huber@embedded-brains.de>
Wed, 13 Apr 2016 11:10:15 +0000 (13:10 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Wed, 13 Apr 2016 11:30:27 +0000 (13:30 +0200)
commit477463a2011ba81907a753df9ce7a71b6563db54
tree909f65c55a7c1d9f8421e2b77047482327e958a3
parenteb6f1d7b77b5a66f036f183d3cb9d4f157a09564
Eliminate use of Newlib-specific <machine/types.h>

This change solves a glibc/BSD compatibility problem.

glibc and BSD use double underscore types for internal types.  The Linux
port of Newlib uses some glibc provided internal type definitions which
are not protected by guard defines, e.g. __off_t.  To avoid a conflict
Newlib uses single underscore types for some internal types, e.g.
_off_t.  However, for BSD compatibility we have to define the internal
types with double underscore names in <sys/_types.h>.

The header file <machine/types.h> is Newlib-specific.  It was used
instead of <sys/_types.h> to provide the internal type definitions
_CLOCK_T, _TIME_T_, _CLOCKID_T_, _TIMER_T_, and __suseconds_t.  Move
these definitions to <sys/_types.h> (there exist two instances of this
file, one for Linux and one for all other targets).  This makes the
_HAVE_SYSTYPES configuration define obsolete (could possibly break the
__RDOS__ target).  Use the standard <sys/_types.h> include throughout.

Move __loff_t defintion to default (non-Linux) <sys/_types.h>.  Define
it via _off64_t to avoid a dependency on the compiler.

Provide the __off_t definition via default (non-Linux) <sys/_types.h>
based on _off_t for all systems except Cygwin.  For Cygwin use _off64_t.
Define off_t via __off_t.

Provide the __pid_t definition via default (non-Linux) <sys/_types.h>.
This prevents a potential __pid_t and pid_t incompatibility.  Add BSD
guard defines for pid_t.

Signed-off-by: Sebastian Huber <sebastian.huber@embedded-brains.de>
14 files changed:
newlib/libc/include/machine/types.h
newlib/libc/include/reent.h
newlib/libc/include/sys/_timespec.h
newlib/libc/include/sys/_timeval.h
newlib/libc/include/sys/_types.h
newlib/libc/include/sys/config.h
newlib/libc/include/sys/timeb.h
newlib/libc/include/sys/times.h
newlib/libc/include/sys/types.h
newlib/libc/sys/linux/sys/_types.h
newlib/libc/sys/linux/sys/types.h
newlib/libc/sys/rtems/include/machine/_types.h
newlib/libc/sys/sparc64/sys/_timeval.h
winsup/cygwin/include/cygwin/types.h
This page took 0.032856 seconds and 5 git commands to generate.