[PATCH 1/2] Split up endian.h to minimize exposure of BYTE_ORDER.

Andreas Schwab schwab@suse.de
Wed Sep 25 07:34:00 GMT 2019


On Sep 24 2019, Alistair Francis <alistair.francis@wdc.com> wrote:

> diff --git a/inet/netinet/in.h b/inet/netinet/in.h
> index 148bc663fc7..609ad66bcb8 100644
> --- a/inet/netinet/in.h
> +++ b/inet/netinet/in.h
> @@ -380,9 +380,9 @@ extern uint32_t htonl (uint32_t __hostlong)
>  extern uint16_t htons (uint16_t __hostshort)
>       __THROW __attribute__ ((__const__));
>  
> -#include <endian.h>
>  
>  /* Get machine dependent optimized versions of byte swapping functions.  */
> +#include <bits/endian.h>
>  #include <bits/byteswap.h>
>  #include <bits/uintn-identity.h>
>  
> diff --git a/resolv/arpa/nameser_compat.h b/resolv/arpa/nameser_compat.h
> index f1c390f3b91..37c178b5243 100644
> --- a/resolv/arpa/nameser_compat.h
> +++ b/resolv/arpa/nameser_compat.h
> @@ -29,7 +29,7 @@
>  #ifndef _ARPA_NAMESER_COMPAT_
>  #define	_ARPA_NAMESER_COMPAT_
>  
> -#include <endian.h>
> +#include <bits/endian.h>
>  
>  /*%
>   * Structure for query header.  The order of the fields is machine- and

Not sure whether we should change the network headers.  There are
probably uses that depend on BYTE_ORDER to be defined through them.

Andreas.

-- 
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE  1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."



More information about the Libc-alpha mailing list