From 2549c4dc2d47309a7635b85341e8450ce3eab9c6 Mon Sep 17 00:00:00 2001 From: Sebastian Ramacher Date: Wed, 6 Nov 2013 17:24:19 +0100 Subject: Workaround missing bit_AES defines clang provides the same constant as bit_AESNI in some versions, and doesn't provide it at all in others. Signed-off-by: Sebastian Ramacher --- src/cpuid.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/cpuid.c b/src/cpuid.c index 5b4b405..46ece7d 100644 --- a/src/cpuid.c +++ b/src/cpuid.c @@ -24,8 +24,21 @@ #include "Python.h" #include #include "config.h" + #ifdef HAVE_CPUID_H #include + +/* it's bit_AES with gcc */ +#ifndef bit_AES +/* but some versions of clang provide bit_AESNI instead */ +#ifdef bit_AESNI +#define bit_AES bit_AESNI +/* and others do not provide any define at all */ +#else +#define bit_AES 0x02000000 +#endif +#endif + #endif #include "pycrypto_compat.h" -- cgit v1.2.1