1
0
mirror of https://github.com/Interlisp/maiko.git synced 2026-05-01 22:26:50 +00:00

Address older versions of C compiler which don't have __BYTE_ORDER__ (#335)

* Address older versions of C compiler which don't have __BYTE_ORDER__

* Checking for __GNUC__ is not sufficient to determine if builtins are available.

* Add makefile fragment for 32-bit PowerPC on Mac OSX build, and ignore the build directories.

* Add comment describing use of __BIG/LITTLE_ENDIAN__ definition
This commit is contained in:
Nick Briggs
2021-02-06 20:51:42 -08:00
committed by GitHub
parent 9957f5c305
commit d482cc461c
4 changed files with 46 additions and 1 deletions

View File

@@ -137,6 +137,9 @@
# define MAIKO_ARCH_DETECTED 1
#endif
/* Modern GNU C, Clang, Sun Studio provide __BYTE_ORDER__
* Older GNU C (ca. 4.0.1) provides __BIG_ENDIAN__/__LITTLE_ENDIAN__
*/
#if defined(__BYTE_ORDER__)
# if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
# define BYTESWAP 1
@@ -145,6 +148,10 @@
# else
# error "Unknown byte order"
# endif
#elif __BIG_ENDIAN__ == 1
# undef BYTESWAP
#elif __LITTLE_ENDIAN__ == 1
# define BYTESWAP 1
#else
# error "Could not detect byte order"
#endif