Last active
September 16, 2016 06:23
-
-
Save tgarc/678bb02b69201fd084e343927dc3d783 to your computer and use it in GitHub Desktop.
updated patch for compiling pyaudio for windows with msvc
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/setup.py b/setup.py | |
index cccebeb..1472d06 100755 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -79,7 +79,9 @@ if not STATIC_LINKING: | |
else: | |
include_dirs = [os.path.join(portaudio_path, 'include/')] | |
extra_link_args = [ | |
- os.path.join(portaudio_path, 'lib/.libs/libportaudio.a') | |
+ os.path.join(portaudio_path, 'portaudio_static_x64.lib') | |
+ | |
+ # os.path.join(portaudio_path, 'lib/.libs/libportaudio.a') | |
] | |
# platform specific configuration | |
@@ -94,8 +96,10 @@ else: | |
elif sys.platform == 'win32': | |
# i.e., Win32 Python with mingw32 | |
# run: python setup.py build -cmingw32 | |
- external_libraries += ['winmm'] | |
- extra_link_args += ['-lwinmm'] | |
+ # external_libraries += ['winmm'] | |
+ # extra_link_args += ['-lwinmm'] | |
+ external_libraries += ['kernel32', 'user32', 'gdi32', 'winspool', 'shell32', 'ole32', 'oleaut32', 'uuid', 'comdlg32', 'advapi32'] | |
+ | |
elif sys.platform == 'linux2': | |
extra_link_args += ['-lrt', '-lm', '-lpthread'] | |
# GNU/Linux has several audio systems (backends) available; be | |
diff --git a/src/_portaudiomodule.c b/src/_portaudiomodule.c | |
index b5bad08..f215bdf 100644 | |
--- a/src/_portaudiomodule.c | |
+++ b/src/_portaudiomodule.c | |
@@ -36,12 +36,12 @@ | |
#define DEFAULT_FRAMES_PER_BUFFER 1024 | |
/* #define VERBOSE */ | |
-#define min(a, b) \ | |
- ({ \ | |
- __typeof__(a) _a = (a); \ | |
- __typeof__(b) _b = (b); \ | |
- _a < _b ? _a : _b; \ | |
- }) | |
+// #define min(a, b) \ | |
+// ({ \ | |
+// __typeof__(a) _a = (a); \ | |
+// __typeof__(b) _b = (b); \ | |
+// _a < _b ? _a : _b; \ | |
+// }) | |
/************************************************************ | |
* |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
This is an update to the patch provided in the following guide:
https://smaudet.wordpress.com/2014/01/26/building-pyaudio-on-windows-7-x64-using-the-free-msvc-toolchains/