Skip to content
  • Jonathan Gray's avatar
    util: unbreak endian detection on OpenBSD · ad9b24b0
    Jonathan Gray authored and Eric Engestrom's avatar Eric Engestrom committed
    Since cbee1bfb 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: cbee1bfb
    
     ("meson/configure: detect endian.h instead of trying to guess when it's available")
    Signed-off-by: default avatarJonathan Gray <jsg@jsg.id.au>
    Reviewed-by: Eric Engestrom's avatarEric Engestrom <eric@engestrom.ch>
    Part-of: <mesa!5630>
    (cherry picked from commit 7eab6845)
    ad9b24b0