From 5b99bd9f3e418a4b9d6d1b7b7395db6aba48c97c Mon Sep 17 00:00:00 2001 From: Michael Drake Date: Thu, 24 Mar 2022 09:36:03 +0000 Subject: [PATCH] Util: Improve host endian detection for older GCCs. Co-authored-by: John-Mark Bell --- src/util.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/util.h b/src/util.h index cea2d1f..781942b 100644 --- a/src/util.h +++ b/src/util.h @@ -27,9 +27,9 @@ */ static inline bool cyaml__host_is_little_endian(void) { - static const uint16_t test = 1; + const uint16_t test = 1; - return ((const uint8_t *) &test)[0] == 1; + return ((const uint8_t *) &test)[0]; } /**