From 7f5d17891e05458836147cd2b05889fde1e7be19 Mon Sep 17 00:00:00 2001 From: miod <> Date: Wed, 23 Apr 2014 18:40:39 +0000 Subject: Figure out endianness at compile-time, using _BYTE_ORDER from , rather than writing 1 to a 32-bit variable and checking whether the first byte is nonzero. tweaks and ok matthew@; ok beck@ tedu@ --- src/lib/libcrypto/evp/bio_ok.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/lib/libcrypto/evp') diff --git a/src/lib/libcrypto/evp/bio_ok.c b/src/lib/libcrypto/evp/bio_ok.c index fdb742f554..09a762ffac 100644 --- a/src/lib/libcrypto/evp/bio_ok.c +++ b/src/lib/libcrypto/evp/bio_ok.c @@ -120,6 +120,7 @@ #include #include #include +#include #include "cryptlib.h" #include #include @@ -463,9 +464,8 @@ 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) { +{ + if (_BYTE_ORDER == _LITTLE_ENDIAN) { size_t i; unsigned char *p=_ptr,c; -- cgit v1.2.3-55-g6feb