Skip to content

Commit

Permalink
Check that Python is 64-bit before enabling BLAKE2_USE_SSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
nascheme committed Apr 27, 2017
1 parent 40db90c commit c67d2e9
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions setup.py
Expand Up @@ -898,8 +898,11 @@ def detect_modules(self):
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',
Expand Down

0 comments on commit c67d2e9

Please sign in to comment.