]> git.ipfire.org Git - thirdparty/openssl.git/blobdiff - crypto/evp/bio_ok.c
Add and use internal header that implements endianness check
[thirdparty/openssl.git] / crypto / evp / bio_ok.c
index 492cbfe2f2ece9ea19b55940135dbc292e3e63d6..b6f85a1b92035ace06a7921cb95a3580ec647c6f 100644 (file)
@@ -76,6 +76,7 @@
 #include "internal/bio.h"
 #include <openssl/evp.h>
 #include <openssl/rand.h>
+#include "internal/endian.h"
 #include "crypto/evp.h"
 
 static int ok_write(BIO *h, const char *buf, int num);
@@ -418,14 +419,9 @@ static long ok_callback_ctrl(BIO *b, int cmd, BIO_info_cb *fp)
 
 static void longswap(void *_ptr, size_t len)
 {
-    const union {
-        long one;
-        char little;
-    } is_endian = {
-        1
-    };
-
-    if (is_endian.little) {
+    DECLARE_IS_ENDIAN;
+
+    if (IS_LITTLE_ENDIAN) {
         size_t i;
         unsigned char *p = _ptr, c;