From ba5f4687987817902c2727e30b35cb5ad1e61203 Mon Sep 17 00:00:00 2001 From: Eugene Kabanov Date: Tue, 28 Jul 2020 03:09:59 +0300 Subject: [PATCH] Fix BR_UNALIGNED define for ARM architectures. (#11) * Fix BR_UNALIGNED define for ARM architectures. --- bearssl/decls.nim | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/bearssl/decls.nim b/bearssl/decls.nim index e4af8a4..0faf543 100644 --- a/bearssl/decls.nim +++ b/bearssl/decls.nim @@ -42,9 +42,11 @@ else: {.passC: "-DBR_USE_UNIX_TIME=1".} {.passC: "-DBR_USE_URANDOM=1".} -when system.cpuEndian == bigEndian: +when defined(i386) or defined(amd64) or defined(arm64): + {.passC: "-DBR_LE_UNALIGNED=1".} +elif defined(powerpc) or defined(powerpc64): {.passC: "-DBR_BE_UNALIGNED=1".} -else: +elif defined(powerpc64el): {.passC: "-DBR_LE_UNALIGNED=1".} when sizeof(int) == 8: