From 0d0e9facfcea3cf96da3b63285865182fdd5477e Mon Sep 17 00:00:00 2001 From: Uros Majstorovic Date: Thu, 11 Jan 2018 21:28:22 +0100 Subject: refatoring dirs --- code/ecp/crypto/include/machine/endian.h | 40 ++++++++++++++++++++++++++++++++ 1 file changed, 40 insertions(+) create mode 100644 code/ecp/crypto/include/machine/endian.h (limited to 'code/ecp/crypto/include/machine') diff --git a/code/ecp/crypto/include/machine/endian.h b/code/ecp/crypto/include/machine/endian.h new file mode 100644 index 0000000..5ec39af --- /dev/null +++ b/code/ecp/crypto/include/machine/endian.h @@ -0,0 +1,40 @@ +/* + * Public domain + * machine/endian.h compatibility shim + */ + +#ifndef LIBCRYPTOCOMPAT_BYTE_ORDER_H_ +#define LIBCRYPTOCOMPAT_BYTE_ORDER_H_ + +#if defined(_WIN32) + +#define LITTLE_ENDIAN 1234 +#define BIG_ENDIAN 4321 +#define PDP_ENDIAN 3412 + +/* + * Use GCC and Visual Studio compiler defines to determine endian. + */ +#if __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__ +#define BYTE_ORDER LITTLE_ENDIAN +#else +#define BYTE_ORDER BIG_ENDIAN +#endif + +#elif defined(__linux__) +#include + +#elif defined(__sun) || defined(_AIX) || defined(__hpux) +#include +#include + +#elif defined(__sgi) +#include +#include + +#else +#include_next + +#endif + +#endif -- cgit v1.2.3