[pypy-commit] pypy py3.6: define a compile arg, not a macro (arigato)

mattip pypy.commits at gmail.com
Fri Feb 22 07:45:19 EST 2019


Author: Matti Picus <matti.picus at gmail.com>
Branch: py3.6
Changeset: r96126:323ddcb8a8c4
Date: 2019-02-22 14:44 +0200
http://bitbucket.org/pypy/pypy/changeset/323ddcb8a8c4/

Log:	define a compile arg, not a macro (arigato)

diff --git a/lib_pypy/_blake2/_blake2_build.py b/lib_pypy/_blake2/_blake2_build.py
--- a/lib_pypy/_blake2/_blake2_build.py
+++ b/lib_pypy/_blake2/_blake2_build.py
@@ -5,11 +5,14 @@
 from cffi import FFI
 
 IS_ARM = platform.machine().startswith('arm')
+IS_WIN = sys.platform == 'win32'
 if IS_ARM:
     # XXX Choose neon accelaration
-    define_macros = []
+    extra_compile_args = []
+elif IS_WIN:
+    extra_compile_args = ['/arch:SSE2']
 else:
-    define_macros = [('__SSE2__', '1')]
+    extra_compile_args = ['-msse2']
     
     
 
@@ -82,7 +85,7 @@
     sources=[os.path.join(_libdir, 'blake2b.c'),
             ],
     include_dirs=[_libdir],
-    define_macros=define_macros,
+    extra_compile_args=extra_compile_args,
 )
 
 def _replace_b2s(src):
@@ -98,7 +101,7 @@
     sources=[os.path.join(_libdir, 'blake2s.c'),
             ],
     include_dirs=[_libdir],
-    define_macros=define_macros,
+    extra_compile_args=extra_compile_args,
 )
 
 if __name__ == '__main__':


More information about the pypy-commit mailing list