$NetBSD: patch-ac,v 1.1 2002/10/18 13:26:12 jlam Exp $ --- examples/sndfile-play.c.orig Mon Aug 5 18:50:55 2002 +++ examples/sndfile-play.c @@ -20,16 +20,21 @@ #include #include -#if defined (__linux__) +#if defined (__linux__) || defined(USE_OSS) #include #include #include + #ifndef DEV_DSP + #define DEV_DSP "/dev/dsp" + #endif + #elif (defined (__MACH__) && defined (__APPLE__)) #include #include -#elif (defined (sun) && defined (unix)) +#elif (defined (sun) && defined (unix)) || \ + (defined (__NetBSD__) && !defined(USE_OSS)) #include #include #include @@ -49,7 +54,7 @@ ** Linux/OSS functions for playing a sound. */ -#if defined (__linux__) +#if defined (__linux__) || defined(USE_OSS) static int linux_open_dsp_device (int channels, int srate) ; @@ -110,7 +115,7 @@ static int linux_open_dsp_device (int channels, int srate) { int fd, stereo, temp, error ; - if ((fd = open ("/dev/dsp", O_WRONLY, 0)) == -1) + if ((fd = open (DEV_DSP, O_WRONLY, 0)) == -1) { perror("linux_open_dsp_device : open ") ; exit (1) ; } ; @@ -468,7 +473,8 @@ win32_play (int argc, char *argv []) ** Solaris. */ -#if (defined (sun) && defined (unix)) /* ie Solaris */ +#if (defined (sun) && defined (unix)) || \ + (defined (__NetBSD__) && !defined(USE_OSS)) static void solaris_play (int argc, char *argv []) @@ -562,11 +568,12 @@ main (int argc, char *argv []) return 1 ; } ; -#if defined (__linux__) +#if defined (__linux__) || defined(USE_OSS) linux_play (argc, argv) ; #elif (defined (__MACH__) && defined (__APPLE__)) macosx_play (argc, argv) ; -#elif (defined (sun) && defined (unix)) +#elif (defined (sun) && defined (unix)) || \ + (defined (__NetBSD__) && !defined(USE_OSS)) solaris_play (argc, argv) ; #elif (defined (_WIN32) || defined (WIN32)) win32_play (argc, argv) ;