Skip to content

Commit

Permalink
x64 fixed, when running on arm64 Windows
Browse files Browse the repository at this point in the history
x64 python, running on arm64 Windows, reports the exact same architecture
and platform as arm64 python running on arm64 Windows. We can not
distinguish between them here.

For now, neither, numpy nor CFFI support arm64 python on Windows, so we
can simply ignore it. This is ugly.
  • Loading branch information
Bastian Bechtold committed Jan 2, 2025
1 parent 80c62b8 commit 5d59816
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions soundfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -158,9 +158,11 @@
elif _sys.platform == 'win32':
from platform import architecture as _architecture
from platform import machine as _machine
if _machine() == 'ARM64':
_packaged_libname = 'libsndfile_arm64.dll'
elif _architecture()[0] == '64bit':
# this check can not be completed correctly: for x64 binaries running on
# arm64 Windows report the same values as arm64 binaries. For now, neither
# numpy nor cffi are available for arm64, so we can safely assume we're
# in x86 land:
if _architecture()[0] == '64bit':
_packaged_libname = 'libsndfile_x64.dll'
elif _architecture()[0] == '32bit':
_packaged_libname = 'libsndfile_x86.dll'
Expand Down

0 comments on commit 5d59816

Please sign in to comment.