[Mesa-dev] [PATCH] u_endian.h: make endianness check libc agnostic
Eric Engestrom
eric.engestrom at imgtec.com
Wed Mar 21 17:27:42 UTC 2018
On Wednesday, 2018-03-21 10:11:55 -0700, Dylan Baker wrote:
> Quoting Jon Turney (2018-03-21 09:47:23)
> > On 21/03/2018 15:09, Emil Velikov wrote:
> > > Hi Maxin,
> > >
> > > Welcome back ;-)
> > >
> > > On 21 March 2018 at 14:52, <maxin.john at gmail.com> wrote:
> > >> From: Khem Raj <raj.khem at gmail.com>
> > >>
> > >> endianness check is OS wide and not specific to libc.
> > >> Fixes build with musl libc
> > >>
> > >> Signed-off-by: Khem Raj <raj.khem at gmail.com>
> > >> Signed-off-by: Maxin B. John <maxin.john at intel.com>
> > >> ---
> > >> src/util/u_endian.h | 2 +-
> > >> 1 file changed, 1 insertion(+), 1 deletion(-)
> > >>
> > >> diff --git a/src/util/u_endian.h b/src/util/u_endian.h
> > >> index 22d011e..4d5b4f4 100644
> > >> --- a/src/util/u_endian.h
> > >> +++ b/src/util/u_endian.h
> > >> @@ -27,7 +27,7 @@
> > >> #ifndef U_ENDIAN_H
> > >> #define U_ENDIAN_H
> > >>
> > >> -#if defined(__GLIBC__) || defined(ANDROID) || defined(__CYGWIN__)
> > >> +#if defined(__linux__)
> > >
> > > Fairly sure that glibc, musl and android define __linux__, although
> > > I'm having doubts about Cygwin.
> > > Which platforms did you test this patch on?
> >
> > Yes, I have a hard time believing these two lines are equivalent.
> >
> > I don't know why this isn't an autoconf check for endian.h etc.
> >
> > > Jon, will this confirm if this will work on your end, or we'll need to
> > > add the __CYGWIN__ hunk back?
>
> What about haiku? I think they use glibc as well.
>
> While we're down this road and Jon brought it up, why don't we just do this
> check in the build system(s)? That seems much more reliable.
I just did :)
https://patchwork.freedesktop.org/patch/211859/
>
> Dylan
More information about the mesa-dev
mailing list