[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Updated patch for a Windows implementation of play-sound

From: Ben Key
Subject: Updated patch for a Windows implementation of play-sound
Date: Wed, 23 Oct 2002 00:59:34 -0400

This is an updated version of my patch to provide a Windows compatible
implementation of play-sound.  Currently only Emacs version 21.3.5 is
supported by this patch.  I will later be releasing a version of this patch
that supports version 21.2.

The changes made by this patch are as follows:

* nt/nmake.defs and nt/gmake.defs have been modified so that the constant
WINMM is defined in such a way to indicate how to link with the library
WINMM.LIB.  This constant was defined much like the constants ADVAPI32,

* src/lisp.h has been modified so that the preprocessor symbol
_USE_PLAY_SOUND_INTERNAL is defined.  In the pending 21.2 compatible version
of this patch, this change will not be included.  This change is necessary
for version 21.3 because the file w32sound.c is used for both versions and
the name of the play-sound internal function is different in version 21.3
(play-sound-internal) than it is in version 21.2 (play-sound).  If the
preprocessor function _USE_PLAY_SOUND_INTERNAL is defined, the primary
function in w32sound.c is defined as play-sound-internal and it is defined
as play-sound otherwise.

* src/makefile.w32-in has been modified to compile w32sound.c and to link

* src/s/ms-w32.h has been modified so that the preprocessor symbol
HAVE_SOUND is defined.  This enables sound support in Emacs.

* src/sound.c has been modified to avoid any chance of a conflict between
w32sound.c and sound.c.  Previously the statement
  #ifdef HAVE_SOUND
was used to determine whether or not to compile the file.  This has been
changed to
  #if defined(HAVE_SOUND) && !defined(_WIN32)

* src/w32sound.c has been added.  This contains my Windows implementation of
play-sound.  It is conditionally compiled as follows:
  #if defined(HAVE_SOUND) && defined(_WIN32)

This compound test is used to eliminate any possibility of a conflict
between sound.c and w32sound.c.

Also included in this ZIP file is a shell script designed to make applying
this patch easier.  Simply copy both dopatch21_3.sh and
emacs-21.3.50-w32-play-sound.diff into the directory containing your Emacs
source and run the shell script.  Then compile as you normally would.

This version of this patch is much cleaner than my previous version.  I am
no longer defining _WIN32_WINNT or WINVER to 0x0501.  This will eliminate a
large number of compiler warnings.  I also was very careful to make certain
that no changes were added into the patch inadvertently.

This patch has been tested using MSVC 6.0 and MingW 2.0.

I hope that this patch addresses all the issues that arose from my previous

Attachment: emacs-21.3.50-play-sound-patch.zip
Description: Zip compressed data

reply via email to

[Prev in Thread] Current Thread [Next in Thread]