From 96eed7bec97ef1b33bc143e23b9091753e8ed3b6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Manuel=20P=C3=A9gouri=C3=A9-Gonnard?= Date: Thu, 12 Dec 2013 15:49:10 +0100 Subject: [PATCH] Allow to test 32-bit ints more easily --- include/polarssl/bignum.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/include/polarssl/bignum.h b/include/polarssl/bignum.h index df17b129b..681a1de8b 100644 --- a/include/polarssl/bignum.h +++ b/include/polarssl/bignum.h @@ -127,12 +127,18 @@ typedef uint16_t t_uint; typedef uint32_t t_udbl; #define POLARSSL_HAVE_UDBL #else - #if ( defined(_MSC_VER) && defined(_M_AMD64) ) + /* + * 32-bit integers can be forced on 64-bit arches (eg. for testing purposes) + * by defining POLARSSL_HAVE_INT32 and undefining POARSSL_HAVE_ASM + */ + #if ( ! defined(POLARSSL_HAVE_INT32) && \ + defined(_MSC_VER) && defined(_M_AMD64) ) #define POLARSSL_HAVE_INT64 typedef int64_t t_sint; typedef uint64_t t_uint; #else - #if ( defined(__GNUC__) && ( \ + #if ( ! defined(POLARSSL_HAVE_INT32) && \ + defined(__GNUC__) && ( \ defined(__amd64__) || defined(__x86_64__) || \ defined(__ppc64__) || defined(__powerpc64__) || \ defined(__ia64__) || defined(__alpha__) || \