diff --git a/compiler.h b/compiler.h index ced029c9..01e11277 100644 --- a/compiler.h +++ b/compiler.h @@ -103,6 +103,9 @@ char *strsep(char **, const char *); */ #if defined(__386__) || defined(__i386__) || defined(__x86_64__) # define X86_MEMORY 1 +# ifndef WORDS_LITTLEENDIAN +# define WORDS_LITTLEENDIAN 1 +# endif #else # define X86_MEMORY 0 #endif diff --git a/configure.in b/configure.in index da26da9b..9a735141 100644 --- a/configure.in +++ b/configure.in @@ -1,6 +1,6 @@ -dnl Process this file with autoconf 2.59 or later to produce +dnl Process this file with autoconf 2.61 or later to produce dnl a configure script. -AC_PREREQ(2.59) +AC_PREREQ(2.61) AC_INIT(config.h.in) AC_CONFIG_HEADERS(config.h) @@ -48,9 +48,7 @@ AC_PREFIX_PROGRAM(nasm) dnl Checks for programs. dnl Consider AC_USE_SYSTEM_EXTENSIONS if autoconf 2.61 is OK in the future -AC_GNU_SOURCE -AC_ISC_POSIX -AC_MINIX +AC_USE_SYSTEM_EXTENSIONS AC_PROG_CC AC_PROG_LN_S AC_PROG_MAKE_SET @@ -95,6 +93,13 @@ AC_CHECK_HEADERS(stdbool.h) dnl Checks for typedefs, structures, and compiler characteristics. AC_C_CONST AC_TYPE_SIZE_T +AC_C_BIGENDIAN(AC_DEFINE(WORDS_BIGENDIAN),AC_DEFINE(WORDS_LITTLEENDIAN)) +AH_TEMPLATE(WORDS_BIGENDIAN, +[Define to 1 if your processor stores words with the most significant +byte first (like Motorola and SPARC, unlike Intel and VAX).]) +AH_TEMPLATE(WORDS_LITTLEENDIAN, +[Define to 1 if your processor stores words with the most significant +byte first (like Intel and VAX, unlike Motorola and SPARC).]) dnl Checks for library functions. AC_SUBST(XOBJS) diff --git a/wsaa.h b/wsaa.h index b3364890..d70b64a5 100644 --- a/wsaa.h +++ b/wsaa.h @@ -4,10 +4,7 @@ #include "compiler.h" #include "nasmlib.h" -/* XXX: only LITTLE_ENDIAN is actually needed here. The way these - macros is written, it does not require that unaligned references - are permitted. */ -#if X86_MEMORY +#ifdef WORDS_LITTEENDIAN #define WSAACHAR(s,v) \ do { \