Check that Python is 64-bit before enabling BLAKE2_USE_SSE. (GH-1332) (GH-2042)

(cherry picked from commit 6c991bdee7)
This commit is contained in:
Neil Schemenauer 2017-06-15 19:12:46 -07:00 committed by Mariatta
parent 6a90a12470
commit 9cead06076

View file

@ -897,8 +897,11 @@ class PyBuildExt(build_ext):
blake2_deps.append('hashlib.h')
blake2_macros = []
if not cross_compiling and os.uname().machine == "x86_64":
# Every x86_64 machine has at least SSE2.
if (not cross_compiling and
os.uname().machine == "x86_64" and
sys.maxsize > 2**32):
# Every x86_64 machine has at least SSE2. Check for sys.maxsize
# in case that kernel is 64-bit but userspace is 32-bit.
blake2_macros.append(('BLAKE2_USE_SSE', '1'))
exts.append( Extension('_blake2',