Skip to content

Instantly share code, notes, and snippets.

@tgarc
Last active September 16, 2016 06:23
Show Gist options
  • Select an option

  • Save tgarc/678bb02b69201fd084e343927dc3d783 to your computer and use it in GitHub Desktop.

Select an option

Save tgarc/678bb02b69201fd084e343927dc3d783 to your computer and use it in GitHub Desktop.

Revisions

  1. tgarc revised this gist Sep 16, 2016. No changes.
  2. tgarc revised this gist Sep 16, 2016. 1 changed file with 20 additions and 20 deletions.
    40 changes: 20 additions & 20 deletions win.patch
    Original file line number Diff line number Diff line change
    @@ -11,26 +11,7 @@ index cccebeb..1472d06 100755
    +
    + # 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
    # i.e., Win32 Python with mingw32
    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':
    @@ -49,3 +30,22 @@ 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; \
    +// })

    /************************************************************
    *
  3. tgarc created this gist Sep 16, 2016.
    51 changes: 51 additions & 0 deletions win.patch
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,51 @@
    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
    # i.e., Win32 Python with mingw32
    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