[Mesa-dev] [PATCH mesa] u_endian: use non-underscore-prefixed BYTE_ORDER names
Jonathan Gray
jsg at jsg.id.au
Mon Apr 9 08:35:20 UTC 2018
What happened with this patch? It seems the problem it is fixing got
cherry-picked into 17.3 but the fix for master (and now 17.3) is still
not merged?
On Wed, Mar 28, 2018 at 06:05:12PM +0100, Eric Engestrom wrote:
> Cc: Jonathan Gray <jsg at jsg.id.au>
> Signed-off-by: Eric Engestrom <eric.engestrom at imgtec.com>
> ---
> Note: scons was already defining _DEFAULT_SOURCE
> ---
> Android.common.mk | 2 +-
> configure.ac | 2 +-
> meson.build | 1 +
> src/util/u_endian.h | 8 ++++++--
> 4 files changed, 9 insertions(+), 4 deletions(-)
>
> diff --git a/Android.common.mk b/Android.common.mk
> index e8aed48c31ab1704cbcf..74d1c2bf47920da53cb5 100644
> --- a/Android.common.mk
> +++ b/Android.common.mk
> @@ -22,7 +22,7 @@
> # DEALINGS IN THE SOFTWARE.
>
> ifeq ($(LOCAL_IS_HOST_MODULE),true)
> -LOCAL_CFLAGS += -D_GNU_SOURCE
> +LOCAL_CFLAGS += -D_GNU_SOURCE -D_DEFAULT_SOURCE
> endif
>
> LOCAL_C_INCLUDES += \
> diff --git a/configure.ac b/configure.ac
> index 99805e0f2bfd380fae4f..3618bc2ae259174b4f42 100644
> --- a/configure.ac
> +++ b/configure.ac
> @@ -283,7 +283,7 @@ case "$host_os" in
> android=yes
> ;;
> linux*|*-gnu*|gnu*|cygwin*)
> - DEFINES="$DEFINES -D_GNU_SOURCE"
> + DEFINES="$DEFINES -D_GNU_SOURCE -D_DEFAULT_SOURCE"
> ;;
> solaris*)
> DEFINES="$DEFINES -DSVR4"
> diff --git a/meson.build b/meson.build
> index 31907b06fe5d32782da5..098722d09d8b6738645e 100644
> --- a/meson.build
> +++ b/meson.build
> @@ -747,6 +747,7 @@ endif
> # TODO: this is very incomplete
> if ['linux', 'cygwin'].contains(host_machine.system())
> pre_args += '-D_GNU_SOURCE'
> + pre_args += '-D_DEFAULT_SOURCE'
> endif
>
> # Check for generic C arguments
> diff --git a/src/util/u_endian.h b/src/util/u_endian.h
> index e11b381588dbc960e8c3..c40293e6e3c6ff8479ac 100644
> --- a/src/util/u_endian.h
> +++ b/src/util/u_endian.h
> @@ -30,9 +30,13 @@
> #ifdef HAVE_ENDIAN_H
> #include <endian.h>
>
> -#if __BYTE_ORDER == __LITTLE_ENDIAN
> +#ifndef BYTE_ORDER
> +#error "BYTE_ORDER undefined"
> +#endif
> +
> +#if BYTE_ORDER == LITTLE_ENDIAN
> # define PIPE_ARCH_LITTLE_ENDIAN
> -#elif __BYTE_ORDER == __BIG_ENDIAN
> +#elif BYTE_ORDER == BIG_ENDIAN
> # define PIPE_ARCH_BIG_ENDIAN
> #endif
>
> --
> Cheers,
> Eric
>
More information about the mesa-dev
mailing list