shithub: opus-tools

Download patch

ref: 6b9b69a205a882e2a6d2c197772061e2205bfc16
parent: a1b9b21146e544dae584ca3d17212101481b9162
author: Mark Harris <mark.hsj@gmail.com>
date: Tue Jan 2 19:33:20 EST 2018

opusdec: Use HAVE_*SOUNDCARD_H consistently

Check whether the macro is defined rather than sometimes checking
its value.

--- a/src/opusdec.c
+++ b/src/opusdec.c
@@ -76,10 +76,10 @@
 
 #if defined HAVE_LIBSNDIO
 # include <sndio.h>
-#elif defined HAVE_SYS_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H || HAVE_SOUNDCARD_H
-# ifdef HAVE_SYS_SOUNDCARD_H
+#elif defined HAVE_SYS_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H
+# if defined HAVE_SYS_SOUNDCARD_H
 #  include <sys/soundcard.h>
-# elif HAVE_MACHINE_SOUNDCARD_H
+# elif defined HAVE_MACHINE_SOUNDCARD_H
 #  include <machine/soundcard.h>
 # else
 #  include <soundcard.h>
@@ -310,7 +310,7 @@
           fprintf(stderr, "could not start sndio\n");
           quit(1);
       }
-#elif defined HAVE_SYS_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H || HAVE_SOUNDCARD_H
+#elif defined HAVE_SYS_SOUNDCARD_H || defined HAVE_MACHINE_SOUNDCARD_H || defined HAVE_SOUNDCARD_H
       int audio_fd, format, stereo;
       audio_fd=open("/dev/dsp", O_WRONLY);
       if (audio_fd<0)