diff options
author | Ed Maste <emaste@freebsd.org> | 2019-01-08 13:48:04 -0500 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-01-08 18:23:52 -0600 |
commit | a30a4431bacd2856ceb6b56cf5ee94694b606194 (patch) | |
tree | 50cd43e53980d99487e315e30d4aa87bbc6e85ea /lib | |
parent | bcbb580fdc3f9c0573eb21c43f5baf52b8bbbd2f (diff) | |
download | toybox-a30a4431bacd2856ceb6b56cf5ee94694b606194.tar.gz |
Add FreeBSD endianness support
Diffstat (limited to 'lib')
-rw-r--r-- | lib/portability.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/lib/portability.h b/lib/portability.h index 48cb490a..a049e7a6 100644 --- a/lib/portability.h +++ b/lib/portability.h @@ -125,6 +125,16 @@ char *strcasestr(const char *haystack, const char *needle); int clearenv(void); +#elif defined(__FreeBSD__) + +#include <sys/endian.h> + +#if _BYTE_ORDER == _BIG_ENDIAN +#define IS_BIG_ENDIAN 1 +#else +#define IS_BIG_ENDIAN 0 +#endif + #else #include <byteswap.h> @@ -166,7 +176,7 @@ int clearenv(void); #ifdef __APPLE__ #include <util.h> -#else +#elif !defined(__FreeBSD__) #include <pty.h> #endif |