summaryrefslogtreecommitdiff
path: root/src/util/u_endian.h
AgeCommit message (Collapse)AuthorFilesLines
2020-08-31util: unbreak endian detection on OpenBSDJonathan Gray1-4/+13
Since cbee1bfb34274668a05995b9d4c78ddec9e5ea4c endian.h is unconditionally used if available. glibc has byte order defines with two leading underscores. OpenBSD has private defines with a single leading underscore in machine/endian.h and public defines in endian.h with no underscore. The code under the endian.h block did not check if symbols were defined before equating them so '#if __BYTE_ORDER == __LITTLE_ENDIAN' would turn into '#if 0 == 0' which is always true. Fixes: cbee1bfb342 ("meson/configure: detect endian.h instead of trying to guess when it's available") Signed-off-by: Jonathan Gray <jsg@jsg.id.au> Reviewed-by: Eric Engestrom <eric@engestrom.ch> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5630>
2019-11-13util/android: fix android build errorsTapani Pälli1-1/+1
Fixes: 9020f519 ("util/u_endian: Add error checks") Closes: https://gitlab.freedesktop.org/mesa/mesa/issues/2078 Signed-off-by: Tapani Pälli <tapani.palli@intel.com> Reviewed-by: Kristian H. Kristensen <hoegsberg@google.com>
2019-11-05util/u_endian: Add error checksDylan Baker1-0/+6
As suggested by Eric Engestrom and Michel Dänzer.
2019-11-05util: rename PIPE_ARCH_*_ENDIAN to UTIL_ARCH_*_ENDIANDylan Baker1-18/+18
As requested by Tim. This was generated with: grep 'PIPE_ARCH_.*_ENDIAN' -rIl | xargs sed -ie 's@PIPE_ARCH_\(.*\)_ENDIAN@UTIL_ARCH_\1_ENDIAN@'g v2: - add this patch Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05util/u_endian: set PIPE_ARCH_*_ENDIAN to 1Dylan Baker1-9/+18
This will allow it to be used as a drop in replacement for _mesa_little_endian in a number of cases. v2: - Always define PIPE_ARCH_LITTLE_ENDIAN and PIPE_ARCH_BIG_ENDIAN, define the one that reflects the host system to 1 and the other to 0 - replace all uses of #ifdef, #ifndef, and #if defined() with #if and #if ! with PIPE_ARCH_*_ENDIAN Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2019-11-05util/u_endian: Use _WIN32 instead of _MSC_VERDylan Baker1-1/+1
_WIN32 is defined by basically all windows compilers (MSVC, ICL, MinGW), wereas _MSC_VER is not defined by MinGW. Without this change MinGW falls through and doesn't define PIPE_ARCH at all, and is caught by some extra code in gallium. Reviewed-by: Eric Engestrom <eric@engestrom.ch>
2018-03-23meson/configure: detect endian.h instead of trying to guess when it's availableEric Engestrom1-1/+1
Cc: Maxin B. John <maxin.john@gmail.com> Cc: Khem Raj <raj.khem@gmail.com> Cc: Rob Herring <robh@kernel.org> Suggested-by: Jon Turney <jon.turney@dronecode.org.uk> Signed-off-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Emil Velikov <emil.velikov@collabora.com> Reviewed-by: Dylan Baker <dylan@pnwbakers.com> Cc: <mesa-stable@lists.freedesktop.org>
2017-11-29util: Also include endian.h on cygwinJon Turney1-1/+1
If u_endian.h can't determine the endianess, the default behaviour in sha1.c is to build for big-endian Signed-off-by: Jon Turney <jon.turney@dronecode.org.uk> Reviewed-by: Matt Turner <mattst88@gmail.com>
2017-11-25util: Just give up and define PIPE_ARCH_LITTLE_ENDIAN on MSVCMatt Turner1-2/+3
MSVC doesn't support #warning?! Getting really tired of this.
2017-11-25util: Use preprocessor correctlyMatt Turner1-1/+1
Fixes: 6a353479a757 ("util: Assume little endian in the absence of platform-specific handling")
2017-11-25util: Assume little endian in the absence of platform-specific handlingMatt Turner1-0/+3
2017-10-26util: use OpenBSD/NetBSD code on FreeBSD/DragonFlyGreg V1-1/+2
Obtained from: FreeBSD ports Reviewed-by: Eric Engestrom <eric.engestrom@imgtec.com> Reviewed-by: Brian Paul <brianp@vmware.com> [Emil Velikov: wrap long line] Reviewed-by: Emil Velikov <emil.velikov@collabora.com>
2016-09-13u_endian: add android to glibc clauseDave Airlie1-1/+1
Tested-by: Mauro Rossi <issor.oruam@gmail.com>
2016-09-06gallium/util: move endian detect into a separate fileDave Airlie1-0/+69
This just ports the simpler endian detection bits, addrlib sharing wants this outside gallium. Acked-by: Marek Olšák <marek.olsak@amd.com> Reviewed-by: Nicolai Hähnle <nicolai.haehnle@amd.com>