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/libssl/d1_pkt.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'src/lib/libssl/d1_pkt.c') diff --git a/src/lib/libssl/d1_pkt.c b/src/lib/libssl/d1_pkt.c index 80a4c076bf..7cfada4e6b 100644 --- a/src/lib/libssl/d1_pkt.c +++ b/src/lib/libssl/d1_pkt.c @@ -115,6 +115,7 @@ #include #include +#include #include "ssl_locl.h" #include #include @@ -129,13 +130,9 @@ satsub64be(const unsigned char *v1, const unsigned char *v2) if (sizeof(long) == 8) do { - const union { - long one; - char little; - } is_endian = {1}; long l; - if (is_endian.little) + if (_BYTE_ORDER == _LITTLE_ENDIAN) break; /* not reached on little-endians */ /* following test is redundant, because input is -- cgit v1.2.3-55-g6feb