From ffeb70b48a13ef5b669ab5b5b6238392efcb5bd2 Mon Sep 17 00:00:00 2001 From: Steffen Jaeckel Date: Thu, 3 Apr 2014 22:22:01 +0200 Subject: [PATCH] fix typedef of LTC_FAST_TYPE on x86_64 --- src/headers/tomcrypt_cfg.h | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/src/headers/tomcrypt_cfg.h b/src/headers/tomcrypt_cfg.h index 82be01b..8b06b14 100644 --- a/src/headers/tomcrypt_cfg.h +++ b/src/headers/tomcrypt_cfg.h @@ -82,14 +82,6 @@ LTC_EXPORT int LTC_CALL XSTRCMP(const char *s1, const char *s2); #define LTC_FAST #endif -#ifdef LTC_FAST -#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ -#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway -#else -typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; -#endif -#endif /* LTC_FAST */ - /* fix for MSVC ...evil! */ #ifdef _MSC_VER #define CONST64(n) n ## ui64 @@ -108,6 +100,18 @@ typedef unsigned int __attribute__((__may_alias__)) LTC_FAST_TYPE; typedef unsigned long ulong32; #endif +#ifdef LTC_FAST +#if __GNUC__ < 4 /* if the compiler does not support gnu extensions, i.e. its neither clang nor gcc */ +#error the LTC_FAST hack is only available on compilers that support __attribute__((may_alias)) - disable it for your compiler, and dont worry, it won`t buy you much anyway +#else +#ifdef ENDIAN_64BITWORD +typedef ulong64 __attribute__((__may_alias__)) LTC_FAST_TYPE; +#else +typedef ulong32 __attribute__((__may_alias__)) LTC_FAST_TYPE; +#endif +#endif +#endif /* LTC_FAST */ + /* detect sparc and sparc64 */ #if defined(__sparc__) #define ENDIAN_BIG