diff libinterp/dldfcn/audiodevinfo.cc @ 19526:7f271cef5850

protect all portaudio and sndfile dependent code with #ifdefs * audiodevinfo.cc: Protect all code that depends on portaudio with #ifdef HAVE_PORTAUDIO * audioread.cc: Protect all code that depends on sndfile with #ifdef HAVE_SNDFILE.
author John W. Eaton <jwe@octave.org>
date Sat, 03 Jan 2015 02:01:23 -0500
parents e616c2830413
children 4f615cd9a68d
line wrap: on
line diff
--- a/libinterp/dldfcn/audiodevinfo.cc	Fri Jan 02 18:05:24 2015 -0800
+++ b/libinterp/dldfcn/audiodevinfo.cc	Sat Jan 03 02:01:23 2015 -0500
@@ -40,8 +40,8 @@
 #include "parse.h"
 
 #if defined (HAVE_PORTAUDIO)
+
 #include <portaudio.h>
-#endif
 
 PaSampleFormat
 bits_to_format (int bits)
@@ -60,6 +60,8 @@
     return 0;
 }
 
+#endif
+
 DEFUN_DLD (audiodevinfo, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {@var{devinfo} =} audiodevinfo ()\n\
@@ -429,6 +431,8 @@
 %! endfor
 */
 
+#ifdef HAVE_PORTAUDIO
+
 enum audio_type { INT8, UINT8, INT16, DOUBLE };
 
 class audioplayer : public octave_base_value
@@ -1638,6 +1642,8 @@
   return stream;
 }
 
+#endif
+
 DEFUN_DLD (__recorder_audiorecorder__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn  {Loadable Function} {@var{recorder} =} __recorder_audiorecorder__ (@var{fs}, @var{nbits}, @var{channels})\n\
@@ -1696,6 +1702,8 @@
   return retval;
 }
 
+#ifdef HAVE_PORTAUDIO
+
 static audiorecorder *
 get_recorder (const octave_value& ov)
 {
@@ -1706,6 +1714,8 @@
   return dynamic_cast<audiorecorder *> (ncrep);
 }
 
+#endif
+
 DEFUN_DLD (__recorder_getaudiodata__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {@var{data}} __recorder_getaudiodata__ (@var{recorder})\n\
@@ -2206,6 +2216,8 @@
   return retval;
 }
 
+#ifdef HAVE_PORTAUDIO
+
 static audioplayer *
 get_player (const octave_value& ov)
 {
@@ -2216,6 +2228,8 @@
   return dynamic_cast<audioplayer *> (ncrep);
 }
 
+#endif
+
 DEFUN_DLD (__player_get_channels__, args, ,
   "-*- texinfo -*-\n\
 @deftypefn {Loadable Function} {@var{n} =} __player_get_channels__ (@var{player})\n\