From e1965094ad8a7601c98b158f7fc5f34ef4d4e165 Mon Sep 17 00:00:00 2001 From: David Garske Date: Fri, 1 Apr 2022 09:23:37 -0700 Subject: [PATCH] Add check for ULONG_MAX in SP math to detect if pre-processor correctly handles 64-bit types. --- wolfssl/wolfcrypt/sp_int.h | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wolfssl/wolfcrypt/sp_int.h b/wolfssl/wolfcrypt/sp_int.h index 794a67480..4492bdee9 100644 --- a/wolfssl/wolfcrypt/sp_int.h +++ b/wolfssl/wolfcrypt/sp_int.h @@ -95,7 +95,9 @@ extern "C" { #error "Size of unsigned int not detected" #endif -#if ULONG_MAX == 18446744073709551615ULL +#if ULONG_MAX == 18446744073709551615ULL && \ + 4294967295UL != 18446744073709551615ULL /* verify pre-processor supports + * 64-bit ULL types */ #define SP_ULONG_BITS 64 typedef unsigned long sp_uint64;