34 lines
1.1 KiB
Text
34 lines
1.1 KiB
Text
|
Index: src/sha.h
|
||
|
--- src/sha.h.orig
|
||
|
+++ src/sha.h
|
||
|
@@ -8,6 +8,7 @@
|
||
|
#ifndef __LIBSTROPHE_SHA_H__
|
||
|
#define __LIBSTROPHE_SHA_H__
|
||
|
|
||
|
+#include <endian.h>
|
||
|
#include <string.h>
|
||
|
|
||
|
#ifdef __cplusplus
|
||
|
@@ -19,7 +20,9 @@ extern "C" {
|
||
|
|
||
|
#if defined(__BIG_ENDIAN__) || \
|
||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_BIG_ENDIAN__) && \
|
||
|
- __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__)
|
||
|
+ __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__) || \
|
||
|
+ (defined(BYTE_ORDER) && defined(BIG_ENDIAN) && \
|
||
|
+ BYTE_ORDER == BIG_ENDIAN)
|
||
|
|
||
|
#define STORE32H(x, y) \
|
||
|
do { \
|
||
|
@@ -46,7 +49,9 @@ extern "C" {
|
||
|
|
||
|
#elif defined(__LITTLE_ENDIAN__) || \
|
||
|
(defined(__BYTE_ORDER__) && defined(__ORDER_LITTLE_ENDIAN__) && \
|
||
|
- __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__)
|
||
|
+ __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__) || \
|
||
|
+ (defined(BYTE_ORDER) && defined(LITTLE_ENDIAN) && \
|
||
|
+ BYTE_ORDER == LITTLE_ENDIAN)
|
||
|
|
||
|
#define STORE32H(x, y) \
|
||
|
do { \
|