[PATCH 1/2] Eliminate use of Newlib-specific <machine/types.h>
Corinna Vinschen
vinschen@redhat.com
Tue Apr 12 14:18:00 GMT 2016
Hi Sebastian,
On Apr 12 10:50, Sebastian Huber wrote:
> 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.
>
> Provide the __off_t definition via default (non-Linux) <sys/_types.h>
> based on _off_t. This prevents a potential __off_t and _off_t
> incompatibility.
> [...]
> diff --git a/newlib/libc/include/machine/types.h b/newlib/libc/include/machine/types.h
> index 4250ee3..71e6139 100644
> --- a/newlib/libc/include/machine/types.h
> +++ b/newlib/libc/include/machine/types.h
> @@ -2,31 +2,16 @@
> #define _MACHTYPES_H_
>
> /*
> - * The following section is RTEMS specific and is needed to more
> - * closely match the types defined in the BSD machine/types.h.
> - * This is needed to let the RTEMS/BSD TCP/IP stack compile.
> + * This file is provided for backward compatibility. It is no longer used in
> + * Newlib. Do not add new things to it.
> */
> -#if defined(__rtems__)
> -#include <machine/_types.h>
> -#endif
>
> -#define _CLOCK_T_ unsigned long /* clock() */
> -#define _TIME_T_ long /* time() */
> -#define _CLOCKID_T_ unsigned long
> -#define _TIMER_T_ unsigned long
> +#include <sys/_types.h>
>
> -#ifndef _HAVE_SYSTYPES
> -typedef long int __off_t;
> -typedef int __pid_t;
> #ifdef __GNUC__
> __extension__ typedef long long int __loff_t;
> #else
> typedef long int __loff_t;
> #endif
> -#endif
This breaks Cygwin since __loff_t is not defined anymore. What's the
reason to keep __loff_t in machine/types.h and then not including it
anymore? In glibc __loff_t is defined in bits/types.h so I guess this
patch should move it to sys/_types.h as well.
Corinna
--
Corinna Vinschen
Cygwin Maintainer
Red Hat
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: not available
URL: <http://sourceware.org/pipermail/newlib/attachments/20160412/57abea26/attachment.sig>
More information about the Newlib
mailing list