Stephen,
Thanks for this patch. It will go into 21.1.12.
- vin
>>>> On Wed, 2 Aug 2000, "Stephen J. Turnbull"
<turnbull(a)sk.tsukuba.ac.jp> said:
Stephen> OK, here is a patch to handle (NAS_)?LITTLE_ENDIAN correctly for old
Stephen> and new versions of NAS. It works correctly on my freshly updated
Stephen> XEmacs 21.1.11, NAS 1.2p5, Debian (woody) Linux (2.2.10) system.
Stephen> I believe this is safe with respect to other possible changes in NAS
Stephen> header usage as a quick check of other NAS headers indicates that they
Stephen> already (as of 1.2p5) used prefixes to prevent namespace pollution.
Stephen> For 21.1 assuming Raymond and Edwin report no problems. 21.2 requires
Stephen> a separate patch.
Stephen> Raymond, Edwin, would you apply the patch, run autoconf, and see if it
Stephen> works correctly on your systems? (I will also send the configure
Stephen> script I generated in a separate mail; you should throw it away if you
Stephen> have autoconf.) (1) Grepping src/config.h for "NAS_" should result
in
Stephen> some stuff including
Stephen> /* #undef NAS_USES_OWN_NAMESPACE */
Stephen> on Raymond's NAS 1.2p5 system, and
Stephen> #define NAS_USES_OWN_NAMESPACE 1
Stephen> on Edwin's more recent system. (2) Also (Edwin especially) rebuild to
Stephen> make sure there are no link errors and that sounds actually come out.
Stephen> Note that the compiler will probably complain about start_interrupts;
Stephen> I have a separate patch to fix that (unrelated) problem.
Stephen> root Changelog:
Stephen> 2000-08-02 Stephen J. Turnbull <stephen(a)xemacs.org>
Stephen> * configure.in: Check for NAS_BIG_ENDIAN in <audio/fileutil.h>.
Stephen> src/Changelog:
Stephen> 2000-08-02 Stephen J. Turnbull <stephen(a)xemacs.org>
Stephen> * nas.c: Make manipulation of *_ENDIAN macros conditional on
Stephen> NAS_USES_OWN_NAMESPACE (cf. 2000-07-29 Edwin Wiles patch)
Stephen> * config.h.in: Added NAS_USES_OWN_NAMESPACE.
Stephen> patch:
Stephen> Index: configure.in
Stephen> ===================================================================
Stephen> RCS file: /usr/CVSroot/XEmacs/xemacs/configure.in,v
Stephen> retrieving revision 1.141
Stephen> diff -u -r1.141 configure.in
Stephen> --- configure.in 2000/07/31 00:33:05 1.141
Stephen> +++ configure.in 2000/08/02 03:58:37
Stephen> @@ -3437,6 +3437,9 @@
Stephen> dnl If the nas library does not contain the error jump point,
Stephen> dnl then we force safer behaviour.
Stephen>
AC_EGREP_HEADER(AuXtErrorJump,audio/Xtutil.h,,[AC_DEFINE(NAS_NO_ERROR_JUMP)])
Stephen> + dnl NAS <= 1.2p5 defines {BIG,LITTLE}_ENDIAN in conflict with GNU libc
etc
Stephen> + dnl Recent NAS prefixes NAS_ to avoid polluting namespace
Stephen> +
AC_EGREP_HEADER(NAS_BIG_ENDIAN,audio/fileutil.h,[AC_DEFINE(NAS_USES_OWN_NAMESPACE)])
Stephen> esac
Stephen> dnl ---------------------
Stephen> Index: src/config.h.in
Stephen> ===================================================================
Stephen> RCS file: /usr/CVSroot/XEmacs/xemacs/src/config.h.in,v
Stephen> retrieving revision 1.56
Stephen> diff -u -r1.56 config.h.in
Stephen> --- config.h.in 2000/07/31 00:33:15 1.56
Stephen> +++ config.h.in 2000/08/02 03:58:38
Stephen> @@ -579,9 +579,12 @@
Stephen> /* Compile in support for NAS (Network Audio System)?
Stephen> NAS_NO_ERROR_JUMP means that the NAS libraries don't include some
Stephen> - error handling changes. */
Stephen> + error handling changes.
Stephen> + NAS_USES_OWN_NAMESPACE means NAS headers define NAS_LITTLE_ENDIAN
Stephen> + instead of LITTLE_ENDIAN etc. */
Stephen> #undef HAVE_NAS_SOUND
Stephen> #undef NAS_NO_ERROR_JUMP
Stephen> +#undef NAS_USES_OWN_NAMESPACE
Stephen> /* Compile in support for SunPro usage-tracking code? */
Stephen> #undef USAGE_TRACKING
Stephen> Index: src/nas.c
Stephen> ===================================================================
Stephen> RCS file: /usr/CVSroot/XEmacs/xemacs/src/nas.c,v
Stephen> retrieving revision 1.5
Stephen> diff -u -r1.5 nas.c
Stephen> --- nas.c 2000/07/31 00:33:15 1.5
Stephen> +++ nas.c 2000/08/02 03:58:38
Stephen> @@ -69,12 +69,22 @@
Stephen> #include <stdio.h>
Stephen> #include "syssignal.h"
Stephen> -#undef NAS_LITTLE_ENDIAN
Stephen> -#undef NAS_BIG_ENDIAN
Stephen> +/* NAS 1.2p5 and previous define these in conflict with GNU libc (at least)
*/
Stephen> +#ifndef NAS_USES_OWN_NAMESPACE
Stephen> +#undef LITTLE_ENDIAN
Stephen> +#undef BIG_ENDIAN
Stephen> +#endif
Stephen> +
Stephen> #include <audio/audiolib.h>
Stephen> #include <audio/soundlib.h>
Stephen> #include <audio/snd.h>
Stephen> #include <audio/fileutil.h>
Stephen> +
Stephen> +/* If needed (NAS <= 1.2p5) define the NAS_ versions of *_ENDIAN */
Stephen> +#ifndef NAS_USES_OWN_NAMESPACE
Stephen> +#define NAS_LITTLE_ENDIAN LITTLE_ENDIAN
Stephen> +#define NAS_BIG_ENDIAN BIG_ENDIAN
Stephen> +#endif
Stephen> #ifdef emacs
Stephen> --
Stephen> University of Tsukuba Tennodai 1-1-1 Tsukuba 305-8573 JAPAN
Stephen> Institute of Policy and Planning Sciences Tel/fax: +81 (298) 53-5091
Stephen> _________________ _________________ _________________ _________________
Stephen> What are those straight lines for? "XEmacs rules."