diff src/nas.c @ 365:30d2cfa1092a r21-1-12

Import from CVS: tag r21-1-12
author cvs
date Mon, 13 Aug 2007 11:00:12 +0200
parents c5d627a313b1
children cc15677e0335
line wrap: on
line diff
--- a/src/nas.c	Mon Aug 13 10:59:30 2007 +0200
+++ b/src/nas.c	Mon Aug 13 11:00:12 2007 +0200
@@ -54,6 +54,8 @@
 #ifdef emacs
 #include <config.h>
 #include "lisp.h"
+#include "sysdep.h"		/* for (start|stop)_interrupts */
+#include "syssignal.h"
 #endif
 
 #if __STDC__ || defined (STDC_HEADERS)
@@ -67,15 +69,24 @@
 #endif
 
 #include <stdio.h>
-#include "syssignal.h"
 
+/* NAS 1.2p5 and previous define these in conflict with GNU libc (at least) */
+#ifndef NAS_USES_OWN_NAMESPACE
 #undef LITTLE_ENDIAN
 #undef BIG_ENDIAN
+#endif
+
 #include <audio/audiolib.h>
 #include <audio/soundlib.h>
 #include <audio/snd.h>
 #include <audio/fileutil.h>
 
+/* If needed (NAS <= 1.2p5) define the NAS_ versions of *_ENDIAN */
+#ifndef NAS_USES_OWN_NAMESPACE
+#define NAS_LITTLE_ENDIAN LITTLE_ENDIAN
+#define NAS_BIG_ENDIAN BIG_ENDIAN
+#endif
+
 #ifdef emacs
 
 #    define XTOOLKIT
@@ -666,7 +677,7 @@
 
   memcpy (&si->h, data, sizeof (SndHeader));
 
-  if (LITTLE_ENDIAN)
+  if (NAS_LITTLE_ENDIAN)
     {
       char            n;