diff src/sound.c @ 3072:4c038e89d563

[xemacs-hg @ 2005-11-16 07:22:37 by stephent] Assorted minor fixes. TODO comment in configure.ac: <87irutytzq.fsf@tleepslib.sk.tsukuba.ac.jp> Avoid warning, don't redefine integer types on Mac OS X: <87ek5hytvq.fsf@tleepslib.sk.tsukuba.ac.jp> Fix uninitialized variable: <87acg5yttp.fsf@tleepslib.sk.tsukuba.ac.jp> Eliminate warnings for unused parameters and functions: <8764qtytrp.fsf@tleepslib.sk.tsukuba.ac.jp> Quiet byte-compiler in select.el: <871x1hytow.fsf@tleepslib.sk.tsukuba.ac.jp> Quiet compiler about unused parameters in sound.el: <87wtj9xf16.fsf@tleepslib.sk.tsukuba.ac.jp>
author stephent
date Wed, 16 Nov 2005 07:22:46 +0000
parents 7844ab77b582
children 34cfe24248f6
line wrap: on
line diff
--- a/src/sound.c	Wed Nov 16 07:14:16 2005 +0000
+++ b/src/sound.c	Wed Nov 16 07:22:46 2005 +0000
@@ -51,6 +51,25 @@
 #include "syswindows.h"
 #endif
 
+#ifdef HAVE_NAS_SOUND
+#define USED_IF_HAVE_NAS(decl) decl
+#else
+#define USED_IF_HAVE_NAS(decl) UNUSED (decl)
+#endif
+
+#if defined(HAVE_NATIVE_SOUND) || defined(HAVE_NAS_SOUND)
+#define USED_IF_HAVE_NATIVE_OR_NAS(decl) decl
+#else
+#define USED_IF_HAVE_NATIVE_OR_NAS(decl) UNUSED (decl)
+#endif
+
+#if defined(HAVE_NATIVE_SOUND) || defined(HAVE_NAS_SOUND) \
+  || defined(HAVE_ESD_SOUND)
+#define USED_IF_HAVE_ANY(decl) decl
+#else
+#define USED_IF_HAVE_ANY(decl) UNUSED (decl)
+#endif
+
 #ifdef HAVE_ESD_SOUND
 extern int esd_play_sound_file (Extbyte *file, int vol);
 extern int esd_play_sound_data (Binbyte *data, size_t length, int vol);
@@ -87,7 +106,7 @@
 Windows the sound file must be in WAV format.
   DEVICE defaults to the selected device.
 */
-     (file, volume, device))
+       (file, volume, USED_IF_HAVE_ANY (device)))
 {
   /* This function can call lisp */
   int vol;
@@ -402,7 +421,7 @@
 DEFUN ("device-sound-enabled-p", Fdevice_sound_enabled_p, 0, 1, 0, /*
 Return t if DEVICE is able to play sound.  Defaults to selected device.
 */
-       (device))
+       (USED_IF_HAVE_NATIVE_OR_NAS (device)))
 {
 #ifdef HAVE_NAS_SOUND
   if (DEVICE_CONNECTED_TO_NAS_P (decode_device (device)))
@@ -487,12 +506,6 @@
   return Qnil;    
 }
 
-#ifdef HAVE_NAS_SOUND
-#define USED_IF_HAVE_NAS(decl) decl
-#else
-#define USED_IF_HAVE_NAS(decl) UNUSED (decl)
-#endif
-
 DEFUN ("wait-for-sounds", Fwait_for_sounds, 0, 1, 0, /*
 Wait for all sounds to finish playing on DEVICE.
 */
@@ -608,7 +621,7 @@
 #endif /* HAVE_NATIVE_SOUND */
 
 void
-init_device_sound (struct device *d)
+init_device_sound (struct device * USED_IF_HAVE_NATIVE_OR_NAS (d))
 {
 #ifdef HAVE_NAS_SOUND
   init_nas_sound (d);