This switches libcrypto and libssl to use endian.h over
machine/endian.h, easing some portability contortions. The Austin group
works in mysterious ways, but endian.h also might be a POSIX
standard in the wings, whatever 'Applied' means.
https://www.austingroupbugs.net/view.php?id=162
ok?
diff --git a/src/lib/libcrypto/bn/bn_nist.c b/src/lib/libcrypto/bn/bn_nist.c
index b16584d6b9..4e98adfc8e 100644
--- a/src/lib/libcrypto/bn/bn_nist.c
+++ b/src/lib/libcrypto/bn/bn_nist.c
@@ -56,8 +56,7 @@
*
*/
-#include <machine/endian.h>
-
+#include <endian.h>
#include <stdint.h>
#include <string.h>
diff --git a/src/lib/libcrypto/des/cfb_enc.c b/src/lib/libcrypto/des/cfb_enc.c
index 59a3e71862..84a71bf52e 100644
--- a/src/lib/libcrypto/des/cfb_enc.c
+++ b/src/lib/libcrypto/des/cfb_enc.c
@@ -57,7 +57,7 @@
*/
#include "des_locl.h"
-#include <machine/endian.h>
+#include <endian.h>
/* The input and output are loaded in multiples of 8 bits.
* What this means is that if you hame numbits=12 and length=2
diff --git a/src/lib/libcrypto/gost/gost2814789.c
b/src/lib/libcrypto/gost/gost2814789.c
index f1066f2467..c3d0754339 100644
--- a/src/lib/libcrypto/gost/gost2814789.c
+++ b/src/lib/libcrypto/gost/gost2814789.c
@@ -49,8 +49,7 @@
* ====================================================================
*/
-#include <machine/endian.h>
-
+#include <endian.h>
#include <string.h>
#include <openssl/opensslconf.h>
diff --git a/src/lib/libcrypto/gost/streebog.c
b/src/lib/libcrypto/gost/streebog.c
index 61bce0e32c..c0b2006cd4 100644
--- a/src/lib/libcrypto/gost/streebog.c
+++ b/src/lib/libcrypto/gost/streebog.c
@@ -49,8 +49,7 @@
* ====================================================================
*/
-#include <machine/endian.h>
-
+#include <endian.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/lib/libcrypto/modes/modes_lcl.h
b/src/lib/libcrypto/modes/modes_lcl.h
index f8830e4deb..0d2541c49f 100644
--- a/src/lib/libcrypto/modes/modes_lcl.h
+++ b/src/lib/libcrypto/modes/modes_lcl.h
@@ -6,7 +6,7 @@
* ====================================================================
*/
-#include <machine/endian.h>
+#include <endian.h>
#include <openssl/opensslconf.h>
diff --git a/src/lib/libcrypto/modes/xts128.c b/src/lib/libcrypto/modes/xts128.c
index 0be23d4ea9..e4a89dc77b 100644
--- a/src/lib/libcrypto/modes/xts128.c
+++ b/src/lib/libcrypto/modes/xts128.c
@@ -48,9 +48,10 @@
* ====================================================================
*/
-#include <machine/endian.h>
#include <openssl/crypto.h>
#include "modes_lcl.h"
+
+#include <endian.h>
#include <string.h>
#ifndef MODES_DEBUG
diff --git a/src/lib/libcrypto/rc4/rc4_enc.c b/src/lib/libcrypto/rc4/rc4_enc.c
index bd928b58c9..87223140bc 100644
--- a/src/lib/libcrypto/rc4/rc4_enc.c
+++ b/src/lib/libcrypto/rc4/rc4_enc.c
@@ -56,7 +56,8 @@
* [including the GNU Public Licence.]
*/
-#include <machine/endian.h>
+#include <endian.h>
+
#include <openssl/rc4.h>
#include "rc4_locl.h"
diff --git a/src/lib/libcrypto/sha/sha256.c b/src/lib/libcrypto/sha/sha256.c
index 9c05d3b0f8..632ebb9070 100644
--- a/src/lib/libcrypto/sha/sha256.c
+++ b/src/lib/libcrypto/sha/sha256.c
@@ -9,8 +9,7 @@
#if !defined(OPENSSL_NO_SHA) && !defined(OPENSSL_NO_SHA256)
-#include <machine/endian.h>
-
+#include <endian.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/lib/libcrypto/sha/sha512.c b/src/lib/libcrypto/sha/sha512.c
index 6b95cfa72e..3752aa02fe 100644
--- a/src/lib/libcrypto/sha/sha512.c
+++ b/src/lib/libcrypto/sha/sha512.c
@@ -5,8 +5,7 @@
* ====================================================================
*/
-#include <machine/endian.h>
-
+#include <endian.h>
#include <stdlib.h>
#include <string.h>
diff --git a/src/lib/libcrypto/sha/sha_locl.h b/src/lib/libcrypto/sha/sha_locl.h
index 46c9a39be2..07d4d2d39a 100644
--- a/src/lib/libcrypto/sha/sha_locl.h
+++ b/src/lib/libcrypto/sha/sha_locl.h
@@ -186,7 +186,7 @@ int SHA1_Init(SHA_CTX *c)
#endif
#if !defined(SHA1_ASM)
-#include <machine/endian.h>
+#include <endian.h>
static void HASH_BLOCK_DATA_ORDER (SHA_CTX *c, const void *p, size_t num)
{
const unsigned char *data=p;
diff --git a/src/lib/libcrypto/whrlpool/wp_block.c
b/src/lib/libcrypto/whrlpool/wp_block.c
index 1e00a01330..1ab8630ecd 100644
--- a/src/lib/libcrypto/whrlpool/wp_block.c
+++ b/src/lib/libcrypto/whrlpool/wp_block.c
@@ -36,9 +36,9 @@
*
*/
+#include <endian.h>
#include <string.h>
#include <openssl/crypto.h>
-#include <machine/endian.h>
#include "wp_locl.h"
diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c
index f0f393b0fd..98353e7a1a 100644
--- a/src/lib/libssl/d1_pkt.c
+++ b/src/lib/libssl/d1_pkt.c
@@ -113,8 +113,7 @@
* [including the GNU Public Licence.]
*/
-#include <machine/endian.h>
-
+#include <endian.h>
#include <errno.h>
#include <stdio.h>