$OpenBSD: patch-lib_internal_h,v 1.3 2017/01/21 23:46:01 jsg Exp $
--- lib/internal.h.orig	Sun Jan 22 09:33:13 2017
+++ lib/internal.h	Sun Jan 22 09:34:10 2017
@@ -103,30 +103,7 @@ uint8_t* unshield_header_get_buffer(Header* header, ui
 #define FSIZE(file)     (file ? unshield_fsize(file) : 0)
 #define STREQ(s1,s2)    (0 == strcmp(s1,s2))
 
-#if WORDS_BIGENDIAN
-
-#if HAVE_BYTESWAP_H
-#include <byteswap.h>
-#elif HAVE_SYS_BYTESWAP_H
-#include <sys/byteswap.h>
-#else
-
-/* use our own functions */
-#define IMPLEMENT_BSWAP_XX 1
-#define bswap_16 unshield_bswap_16
-#define bswap_32 unshield_bswap_32
-
-uint16_t bswap_16(uint16_t x);
-uint32_t bswap_32(uint32_t x);
-#endif
-
-#define letoh16(x)    bswap_16(x)
-#define letoh32(x)    bswap_32(x)
-
-#else
-#define letoh32(x) (x)
-#define letoh16(x) (x)
-#endif
+#include <endian.h>
 
 static inline uint16_t get_unaligned_le16(const uint8_t *p)
 {
