APPROVE COMMIT 21.5
Almost everybody has native sound, so I guess it's unusual to see
these. They only occur if you don't have sound at all.
Index: ChangeLog
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/ChangeLog,v
retrieving revision 1.884
diff -u -U0 -r1.884 ChangeLog
--- ChangeLog 13 Nov 2005 10:48:01 -0000 1.884
+++ ChangeLog 16 Nov 2005 05:58:28 -0000
@@ -0,0 +1,7 @@
+2005-11-16 Stephen J. Turnbull <stephen(a)xemacs.org>
+
+ * sound.c (USED_IF_HAVE_NATIVE_OR_NAS, USED_IF_HAVE_ANY):
+ New conditional UNUSED macros.
+ (Fplay_sound_file, Fdevice_sound_enabled_p, init_device_sound):
+ Use them.
+
Index: src/sound.c
===================================================================
RCS file: /pack/xemacscvs/XEmacs/xemacs/src/sound.c,v
retrieving revision 1.24
diff -u -r1.24 sound.c
--- src/sound.c 5 May 2005 17:10:54 -0000 1.24
+++ src/sound.c 16 Nov 2005 04:24:21 -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);
--
Graduate School of Systems and Information Engineering University of Tsukuba
http://turnbull.sk.tsukuba.ac.jp/ Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Economics of Information Communication and Computation Systems
Experimental Economics, Microeconomic Theory, Game Theory