Skip to content

Commit

Permalink
BYTE_ORDER: If '__DARWIN_BYTE_ORDER' isn't defined (eg. on apple-sili…
Browse files Browse the repository at this point in the history
…con), so fall back to '__BYTE_ORDER__' check.
  • Loading branch information
helmesjo committed Oct 30, 2024
1 parent 45c87be commit 34e3fc7
Showing 1 changed file with 9 additions and 5 deletions.
14 changes: 9 additions & 5 deletions libbuild2-autoconf/libbuild2/autoconf/checks/BYTE_ORDER.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,11 +43,15 @@
# define BIG_ENDIAN 4321
# define LITTLE_ENDIAN 1234
# define BYTE_ORDER LITTLE_ENDIAN
# elif defined(__BYTE_ORDER__) && \
defined(__ORDER_BIG_ENDIAN__) && \
defined(__ORDER_LITTLE_ENDIAN__)
/* GCC, Clang (and others, potentially).
*/
# endif
#endif

/* Fallback: GCC, Clang (specifically apple-silicon and others, potentially).
*/
#ifndef BYTE_ORDER
# if defined(__BYTE_ORDER__) && \
defined(__ORDER_BIG_ENDIAN__) && \
defined(__ORDER_LITTLE_ENDIAN__)
# define BYTE_ORDER __BYTE_ORDER__
# define BIG_ENDIAN __ORDER_BIG_ENDIAN__
# define LITTLE_ENDIAN __ORDER_LITTLE_ENDIAN__
Expand Down

0 comments on commit 34e3fc7

Please sign in to comment.