summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@linux-m68k.org>2010-08-09 21:25:41 +0200
committerAndreas Schwab <schwab@linux-m68k.org>2010-08-09 21:25:41 +0200
commit671d409f8b29dac2a8902e1932948404c0cfbc74 (patch)
tree44d3cbd1c4f90309903bfac2bcca8308abac3f70 /src
parent148cef8e7a25f4d05d3b90c78fd8714f64048d24 (diff)
downloademacs-671d409f8b29dac2a8902e1932948404c0cfbc74.tar.gz
Use autoconf determined WORDS_BIGENDIAN instead of hardcoded definition.
* m/alpha.h: Don't define/undef WORDS_BIG_ENDIAN. * m/amdx86-64.h: Likewise. * m/arm.h: Likewise. * m/hp800.h: Likewise. * m/ia64.h: Likewise. * m/ibmrs6000.h: Likewise. * m/ibms390.h: Likewise. * m/intel386.h: Likewise. * m/iris4d.h: Likewise. * m/m68k.h: Likewise. * m/macppc.h: Likewise. * m/mips.h: Likewise. * m/sh3.h: Likewise. * m/sparc.h: Likewise. * m/template.h: Likewise. * m/vax.h: Likewise. * m/xtensa.h: Likewise. * fringe.c (init_fringe_bitmap): Test WORDS_BIGENDIAN instead of WORDS_BIG_ENDIAN. * lisp.h: Likewise. * md5.c: Likewise. * sound.c (le2hl, le2hs, be2hl, be2hs): Likewise. * CPP-DEFINES (WORDS_BIG_ENDIAN): Remove. * configure.in: Add AC_C_BIGENDIAN.
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog28
-rw-r--r--src/config.in15
-rw-r--r--src/fringe.c2
-rw-r--r--src/lisp.h6
-rw-r--r--src/m/alpha.h4
-rw-r--r--src/m/amdx86-64.h4
-rw-r--r--src/m/arm.h4
-rw-r--r--src/m/hp800.h4
-rw-r--r--src/m/ia64.h4
-rw-r--r--src/m/ibmrs6000.h1
-rw-r--r--src/m/ibms390.h4
-rw-r--r--src/m/intel386.h4
-rw-r--r--src/m/iris4d.h4
-rw-r--r--src/m/m68k.h4
-rw-r--r--src/m/macppc.h4
-rw-r--r--src/m/mips.h6
-rw-r--r--src/m/sh3.h4
-rw-r--r--src/m/sparc.h4
-rw-r--r--src/m/template.h4
-rw-r--r--src/m/vax.h4
-rw-r--r--src/m/xtensa.h6
-rw-r--r--src/md5.c6
-rw-r--r--src/sound.c8
23 files changed, 54 insertions, 80 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 6fd89a6339d..09a6bea487d 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,31 @@
+2010-08-09 Andreas Schwab <schwab@linux-m68k.org>
+
+ Use autoconf determined WORDS_BIGENDIAN instead of hardcoded
+ definition.
+
+ * m/alpha.h: Don't define/undef WORDS_BIG_ENDIAN.
+ * m/amdx86-64.h: Likewise.
+ * m/arm.h: Likewise.
+ * m/hp800.h: Likewise.
+ * m/ia64.h: Likewise.
+ * m/ibmrs6000.h: Likewise.
+ * m/ibms390.h: Likewise.
+ * m/intel386.h: Likewise.
+ * m/iris4d.h: Likewise.
+ * m/m68k.h: Likewise.
+ * m/macppc.h: Likewise.
+ * m/mips.h: Likewise.
+ * m/sh3.h: Likewise.
+ * m/sparc.h: Likewise.
+ * m/template.h: Likewise.
+ * m/vax.h: Likewise.
+ * m/xtensa.h: Likewise.
+ * fringe.c (init_fringe_bitmap): Test WORDS_BIGENDIAN instead of
+ WORDS_BIG_ENDIAN.
+ * lisp.h: Likewise.
+ * md5.c: Likewise.
+ * sound.c (le2hl, le2hs, be2hl, be2hs): Likewise.
+
2010-08-09 Dan Nicolaescu <dann@ics.uci.edu>
Use const char* instead of char*.
diff --git a/src/config.in b/src/config.in
index 19ed94376c1..ea17a54d913 100644
--- a/src/config.in
+++ b/src/config.in
@@ -27,6 +27,9 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define EMACS_CONFIG_H
+/* Define if building universal (internal helper macro) */
+#undef AC_APPLE_UNIVERSAL_BUILD
+
/* Define to 1 if the mktime function is broken. */
#undef BROKEN_MKTIME
@@ -976,6 +979,18 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
/* Define to 1 if using an X toolkit. */
#undef USE_X_TOOLKIT
+/* Define WORDS_BIGENDIAN to 1 if your processor stores words with the most
+ significant byte first (like Motorola and SPARC, unlike Intel). */
+#if defined AC_APPLE_UNIVERSAL_BUILD
+# if defined __BIG_ENDIAN__
+# define WORDS_BIGENDIAN 1
+# endif
+#else
+# ifndef WORDS_BIGENDIAN
+# undef WORDS_BIGENDIAN
+# endif
+#endif
+
/* Define this to check for malloc buffer overrun. */
#undef XMALLOC_OVERRUN_CHECK
diff --git a/src/fringe.c b/src/fringe.c
index f24365a1e23..fce100b1463 100644
--- a/src/fringe.c
+++ b/src/fringe.c
@@ -1494,7 +1494,7 @@ init_fringe_bitmap (int which, struct fringe_bitmap *fb, int once_p)
| (swap_nibble[(b>>8) & 0xf] << 4)
| (swap_nibble[(b>>12) & 0xf]));
b >>= (16 - fb->width);
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
b = ((b >> 8) | (b << 8));
#endif
*bits++ = b;
diff --git a/src/lisp.h b/src/lisp.h
index 218c6e630fc..89514bf9ecb 100644
--- a/src/lisp.h
+++ b/src/lisp.h
@@ -254,7 +254,7 @@ enum Lisp_Fwd_Type
#ifdef USE_LISP_UNION_TYPE
-#ifndef WORDS_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
/* Definition of Lisp_Object for little-endian machines. */
@@ -278,7 +278,7 @@ union Lisp_Object
}
Lisp_Object;
-#else /* If WORDS_BIG_ENDIAN */
+#else /* If WORDS_BIGENDIAN */
typedef
union Lisp_Object
@@ -300,7 +300,7 @@ union Lisp_Object
}
Lisp_Object;
-#endif /* WORDS_BIG_ENDIAN */
+#endif /* WORDS_BIGENDIAN */
#ifdef __GNUC__
static __inline__ Lisp_Object
diff --git a/src/m/alpha.h b/src/m/alpha.h
index 5a0168417cb..3b6d7da92df 100644
--- a/src/m/alpha.h
+++ b/src/m/alpha.h
@@ -25,10 +25,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define _LP64 /* This doesn't appear to be necessary on OSF 4/5 -- fx. */
#endif
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
/* __alpha defined automatically */
diff --git a/src/m/amdx86-64.h b/src/m/amdx86-64.h
index 1910c37bffc..30aa2678717 100644
--- a/src/m/amdx86-64.h
+++ b/src/m/amdx86-64.h
@@ -21,10 +21,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically:
Ones defined so far include vax, m68000, ns16000, pyramid,
diff --git a/src/m/arm.h b/src/m/arm.h
index ee5d6c77844..8b659bb5bd0 100644
--- a/src/m/arm.h
+++ b/src/m/arm.h
@@ -18,9 +18,5 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
/* arch-tag: 07856f0c-f0c8-4bd8-99af-0b7fa1e5ee42
(do not change this comment) */
diff --git a/src/m/hp800.h b/src/m/hp800.h
index 3889a1a3e60..9998f701a6b 100644
--- a/src/m/hp800.h
+++ b/src/m/hp800.h
@@ -18,10 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the bit field into an int. In other words, if bit fields
are always unsigned.
diff --git a/src/m/ia64.h b/src/m/ia64.h
index 5266c682c78..bbf09ac878b 100644
--- a/src/m/ia64.h
+++ b/src/m/ia64.h
@@ -23,10 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
#define BITS_PER_LONG 64
#define BITS_PER_EMACS_INT 64
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
/* __ia64__ defined automatically */
diff --git a/src/m/ibmrs6000.h b/src/m/ibmrs6000.h
index a44b2c4ec3b..785719e908b 100644
--- a/src/m/ibmrs6000.h
+++ b/src/m/ibmrs6000.h
@@ -23,7 +23,6 @@ along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
An address of data cannot be stored correctly in a Lisp object;
we always lose the high bits. We must tell XPNTR to add them back. */
#define DATA_START 0x20000000
-#define WORDS_BIG_ENDIAN
#define DATA_SEG_BITS 0x20000000
#ifndef NLIST_STRUCT
diff --git a/src/m/ibms390.h b/src/m/ibms390.h
index 087607b547d..0acc826a1ea 100644
--- a/src/m/ibms390.h
+++ b/src/m/ibms390.h
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the 24-bit bit field into an int. In other words, if bit fields
are always unsigned.
diff --git a/src/m/intel386.h b/src/m/intel386.h
index 2931e9a2284..15601fae76e 100644
--- a/src/m/intel386.h
+++ b/src/m/intel386.h
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
#ifdef WINDOWSNT
#define VIRT_ADDR_VARIES
#define DATA_START get_data_start ()
diff --git a/src/m/iris4d.h b/src/m/iris4d.h
index 526d68ee5fc..31f08d05cfc 100644
--- a/src/m/iris4d.h
+++ b/src/m/iris4d.h
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the bit field into an int. In other words, if bit fields
are always unsigned.
diff --git a/src/m/m68k.h b/src/m/m68k.h
index 2286cbce5e6..8d53424ccec 100644
--- a/src/m/m68k.h
+++ b/src/m/m68k.h
@@ -18,10 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically. */
#ifndef m68k
diff --git a/src/m/macppc.h b/src/m/macppc.h
index 2764ae56115..01735790b20 100644
--- a/src/m/macppc.h
+++ b/src/m/macppc.h
@@ -18,10 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Data type of load average, as read out of kmem. */
#define LOAD_AVE_TYPE long
diff --git a/src/m/mips.h b/src/m/mips.h
index 39a948c0cde..b3a754c2b61 100644
--- a/src/m/mips.h
+++ b/src/m/mips.h
@@ -18,12 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#if ! (defined (__MIPSEL__) || defined (MIPSEL) || defined (_MIPSEL))
-#define WORDS_BIG_ENDIAN
-#endif
-
/* Define EXPLICIT_SIGN_EXTEND if XINT must explicitly sign-extend
the 24-bit bit field into an int. In other words, if bit fields
are always unsigned.
diff --git a/src/m/sh3.h b/src/m/sh3.h
index 703513d23f7..ebfdb5b2d64 100644
--- a/src/m/sh3.h
+++ b/src/m/sh3.h
@@ -1,8 +1,4 @@
/* Machine description file for SuperH. */
-#ifdef __BIG_ENDIAN__
-# define WORDS_BIG_ENDIAN
-#endif
-
/* arch-tag: 1b01b84f-f044-4afa-aa4b-caa54ec38966
(do not change this comment) */
diff --git a/src/m/sparc.h b/src/m/sparc.h
index 6c2c71c4045..26ca3caaebe 100644
--- a/src/m/sparc.h
+++ b/src/m/sparc.h
@@ -18,10 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* __sparc__ is defined by the compiler by default. */
/* XINT must explicitly sign-extend
diff --git a/src/m/template.h b/src/m/template.h
index 7e067849813..4efc9158a45 100644
--- a/src/m/template.h
+++ b/src/m/template.h
@@ -18,10 +18,6 @@ GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#define WORDS_BIG_ENDIAN
-
/* Now define a symbol for the cpu type, if your compiler
does not define it automatically.
Ones defined so far include m68k and many others */
diff --git a/src/m/vax.h b/src/m/vax.h
index 3426a20d55e..16e790a2769 100644
--- a/src/m/vax.h
+++ b/src/m/vax.h
@@ -19,10 +19,6 @@ You should have received a copy of the GNU General Public License
along with GNU Emacs. If not, see <http://www.gnu.org/licenses/>. */
-/* Define WORDS_BIG_ENDIAN if lowest-numbered byte in a word
- is the most significant byte. */
-#undef WORDS_BIG_ENDIAN
-
/* #define vax -- appears to be done automatically */
/* USG systems I know of running on Vaxes do not actually
diff --git a/src/m/xtensa.h b/src/m/xtensa.h
index 664f18dcb10..8e1da54b25b 100644
--- a/src/m/xtensa.h
+++ b/src/m/xtensa.h
@@ -2,11 +2,5 @@
Add a license notice if this grows to > 10 lines of code. */
-#ifdef __LITTLE_ENDIAN
-#undef WORDS_BIG_ENDIAN
-#else
-#define WORDS_BIG_ENDIAN
-#endif
-
/* arch-tag: fe5872de-d565-4d81-8fe0-ea19865b3e6a
(do not change this comment) */
diff --git a/src/md5.c b/src/md5.c
index 1840c2ac92b..6e7f651189e 100644
--- a/src/md5.c
+++ b/src/md5.c
@@ -1,7 +1,7 @@
/* Functions to compute MD5 message digest of files or memory blocks.
according to the definition of MD5 in RFC 1321 from April 1992.
Copyright (C) 1995, 1996, 1997, 1999, 2000, 2001, 2002, 2003, 2004,
- 2005, 2006, 2007 Free Software Foundation, Inc.
+ 2005, 2006, 2007, 2010 Free Software Foundation, Inc.
This file is part of the GNU C Library.
@@ -40,7 +40,7 @@
#ifdef _LIBC
# include <endian.h>
# if __BYTE_ORDER == __BIG_ENDIAN
-# define WORDS_BIG_ENDIAN 1
+# define WORDS_BIGENDIAN 1
# endif
/* We need to keep the namespace clean so define the MD5 function
protected using leading __ . */
@@ -55,7 +55,7 @@
#include "md5.h"
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
# define SWAP(n) \
(((n) << 24) | (((n) & 0xff00) << 8) | (((n) >> 8) & 0xff00) | ((n) >> 24))
#else
diff --git a/src/sound.c b/src/sound.c
index 55804c328a8..b93099283da 100644
--- a/src/sound.c
+++ b/src/sound.c
@@ -481,7 +481,7 @@ sound_cleanup (Lisp_Object arg)
static u_int32_t
le2hl (u_int32_t value)
{
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[0] + (p[1] << 8) + (p[2] << 16) + (p[3] << 24);
#endif
@@ -495,7 +495,7 @@ le2hl (u_int32_t value)
static u_int16_t
le2hs (u_int16_t value)
{
-#ifdef WORDS_BIG_ENDIAN
+#ifdef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[0] + (p[1] << 8);
#endif
@@ -509,7 +509,7 @@ le2hs (u_int16_t value)
static u_int32_t
be2hl (u_int32_t value)
{
-#ifndef WORDS_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[3] + (p[2] << 8) + (p[1] << 16) + (p[0] << 24);
#endif
@@ -525,7 +525,7 @@ be2hl (u_int32_t value)
static u_int16_t
be2hs (u_int16_t value)
{
-#ifndef WORDS_BIG_ENDIAN
+#ifndef WORDS_BIGENDIAN
unsigned char *p = (unsigned char *) &value;
value = p[1] + (p[0] << 8);
#endif