This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 1/2] Split up endian.h to minimize exposure of BYTE_ORDER.
- From: Alistair Francis <alistair23 at gmail dot com>
- To: Andreas Schwab <schwab at suse dot de>
- Cc: Alistair Francis <alistair dot francis at wdc dot com>, GNU C Library <libc-alpha at sourceware dot org>
- Date: Thu, 26 Sep 2019 17:51:45 -0700
- Subject: Re: [PATCH 1/2] Split up endian.h to minimize exposure of BYTE_ORDER.
- References: <20190925002903.15928-1-alistair.francis@wdc.com> <mvmimpgde3e.fsf@suse.de> <CAKmqyKN82QkmGsOYZ1PBOdzqhN_igg=mKE7D_+1uaXq+CmoVYg@mail.gmail.com> <mvm4l0z4k1z.fsf@suse.de>
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."