[PATCH 1/2] Split up endian.h to minimize exposure of BYTE_ORDER.
Alistair Francis
alistair23@gmail.com
Fri Sep 27 00:56:00 GMT 2019
On Thu, Sep 26, 2019 at 12:02 AM Andreas Schwab <schwab@suse.de> wrote:
>
> On Sep 25 2019, Alistair Francis <alistair23@gmail.com> wrote:
>
> > On Wed, Sep 25, 2019 at 12:33 AM Andreas Schwab <schwab@suse.de> wrote:
> >>
> >> 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.
> >
> > Isn't BYTE_ORDER still defined after this patch in the network headers?
>
> Not through <bits/endian.h>, AFAICS.
Ah, I see what you mean. I got confused.
__BYTE_ORDER is exposed in the network headers, while BYTE_ORDER is not.
Do you want me to add #include <endian.h> back to?
- inet/netinet/in.h
- resolv/arpa/nameser_compat.h
Alistair
>
> 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