From e04a0760ca284c8d07378c7c178ce41610fac34c Mon Sep 17 00:00:00 2001 From: Miller Puckette <msp@ucsd.edu> Date: Wed, 17 Dec 2008 09:59:55 -0800 Subject: [PATCH] msw fix --- src/s_audio_pa.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/s_audio_pa.c b/src/s_audio_pa.c index 4ceeb6c6a..66618d46d 100644 --- a/src/s_audio_pa.c +++ b/src/s_audio_pa.c @@ -11,7 +11,6 @@ #include "s_stuff.h" #include <stdio.h> #include <stdlib.h> -#include <unistd.h> #include <portaudio.h> #include "s_audio_pablio.h" @@ -30,11 +29,15 @@ static t_audiocallback pa_callback; int pa_foo; +#ifndef MSW +#include <unistd.h> +#endif static void pa_init(void) { static int initialized; if (!initialized) { +#ifndef MSW /* Initialize PortAudio */ /* for some reason Pa_Initialize(0 closes file descriptor 1. As a workaround, dup it to another number and dup2 it back @@ -46,6 +49,9 @@ static void pa_init(void) dup2(newfd, 1); close(newfd); } +#else + int err = Pa_Initialize(); +#endif if ( err != paNoError ) { fprintf( stderr, -- GitLab