$OpenBSD: patch-Modules_ossaudiodev_c,v 1.3 2014/07/11 06:59:43 rpointel Exp $
--- Modules/ossaudiodev.c.orig	Mon Jun 30 04:05:43 2014
+++ Modules/ossaudiodev.c	Wed Jul  9 11:41:16 2014
@@ -30,7 +30,7 @@
 #endif
 
 #include <sys/ioctl.h>
-#include <sys/soundcard.h>
+#include <soundcard.h>
 
 #if defined(linux)
 
@@ -1039,6 +1039,7 @@ initossaudiodev(void)
 
     /* Expose all the ioctl numbers for masochists who like to do this
        stuff directly. */
+#ifdef SNDCTL_COPR_HALT
     _EXPORT_INT(m, SNDCTL_COPR_HALT);
     _EXPORT_INT(m, SNDCTL_COPR_LOAD);
     _EXPORT_INT(m, SNDCTL_COPR_RCODE);
@@ -1049,6 +1050,7 @@ initossaudiodev(void)
     _EXPORT_INT(m, SNDCTL_COPR_SENDMSG);
     _EXPORT_INT(m, SNDCTL_COPR_WCODE);
     _EXPORT_INT(m, SNDCTL_COPR_WDATA);
+#endif
 #ifdef SNDCTL_DSP_BIND_CHANNEL
     _EXPORT_INT(m, SNDCTL_DSP_BIND_CHANNEL);
 #endif
@@ -1091,18 +1093,25 @@ initossaudiodev(void)
     _EXPORT_INT(m, SNDCTL_DSP_STEREO);
     _EXPORT_INT(m, SNDCTL_DSP_SUBDIVIDE);
     _EXPORT_INT(m, SNDCTL_DSP_SYNC);
+#ifdef SNDCTL_FM_4OP_ENABLE
     _EXPORT_INT(m, SNDCTL_FM_4OP_ENABLE);
     _EXPORT_INT(m, SNDCTL_FM_LOAD_INSTR);
+#endif
+#ifdef SNDCTL_MIDI_INFO
     _EXPORT_INT(m, SNDCTL_MIDI_INFO);
     _EXPORT_INT(m, SNDCTL_MIDI_MPUCMD);
     _EXPORT_INT(m, SNDCTL_MIDI_MPUMODE);
     _EXPORT_INT(m, SNDCTL_MIDI_PRETIME);
+#endif
+#ifdef SNDCTL_SEQ_CTRLRATE
     _EXPORT_INT(m, SNDCTL_SEQ_CTRLRATE);
     _EXPORT_INT(m, SNDCTL_SEQ_GETINCOUNT);
     _EXPORT_INT(m, SNDCTL_SEQ_GETOUTCOUNT);
+#endif
 #ifdef SNDCTL_SEQ_GETTIME
     _EXPORT_INT(m, SNDCTL_SEQ_GETTIME);
 #endif
+#ifdef SNDCTL_SEQ_NRMIDIS
     _EXPORT_INT(m, SNDCTL_SEQ_NRMIDIS);
     _EXPORT_INT(m, SNDCTL_SEQ_NRSYNTHS);
     _EXPORT_INT(m, SNDCTL_SEQ_OUTOFBAND);
@@ -1113,17 +1122,21 @@ initossaudiodev(void)
     _EXPORT_INT(m, SNDCTL_SEQ_SYNC);
     _EXPORT_INT(m, SNDCTL_SEQ_TESTMIDI);
     _EXPORT_INT(m, SNDCTL_SEQ_THRESHOLD);
+#endif
 #ifdef SNDCTL_SYNTH_CONTROL
     _EXPORT_INT(m, SNDCTL_SYNTH_CONTROL);
 #endif
 #ifdef SNDCTL_SYNTH_ID
     _EXPORT_INT(m, SNDCTL_SYNTH_ID);
 #endif
+#ifdef SNDCTL_SYNTH_INFO
     _EXPORT_INT(m, SNDCTL_SYNTH_INFO);
     _EXPORT_INT(m, SNDCTL_SYNTH_MEMAVL);
+#endif
 #ifdef SNDCTL_SYNTH_REMOVESAMPLE
     _EXPORT_INT(m, SNDCTL_SYNTH_REMOVESAMPLE);
 #endif
+#ifdef SNDCTL_TMR_CONTINUE
     _EXPORT_INT(m, SNDCTL_TMR_CONTINUE);
     _EXPORT_INT(m, SNDCTL_TMR_METRONOME);
     _EXPORT_INT(m, SNDCTL_TMR_SELECT);
@@ -1132,4 +1145,5 @@ initossaudiodev(void)
     _EXPORT_INT(m, SNDCTL_TMR_STOP);
     _EXPORT_INT(m, SNDCTL_TMR_TEMPO);
     _EXPORT_INT(m, SNDCTL_TMR_TIMEBASE);
+#endif
 }
