Use autoconf to detect WORDS_LITTLEENDIAN
Use autoconf to detect littleendian word order, and use WORDS_LITTLEENDIAN instead of X86_MEMORY when we don't require unaligned memory accesses to be permitted.
This commit is contained in:
parent
cb38f505e4
commit
2f0f9ea286
3 changed files with 14 additions and 9 deletions
|
@ -103,6 +103,9 @@ char *strsep(char **, const char *);
|
||||||
*/
|
*/
|
||||||
#if defined(__386__) || defined(__i386__) || defined(__x86_64__)
|
#if defined(__386__) || defined(__i386__) || defined(__x86_64__)
|
||||||
# define X86_MEMORY 1
|
# define X86_MEMORY 1
|
||||||
|
# ifndef WORDS_LITTLEENDIAN
|
||||||
|
# define WORDS_LITTLEENDIAN 1
|
||||||
|
# endif
|
||||||
#else
|
#else
|
||||||
# define X86_MEMORY 0
|
# define X86_MEMORY 0
|
||||||
#endif
|
#endif
|
||||||
|
|
15
configure.in
15
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.
|
dnl a configure script.
|
||||||
AC_PREREQ(2.59)
|
AC_PREREQ(2.61)
|
||||||
AC_INIT(config.h.in)
|
AC_INIT(config.h.in)
|
||||||
AC_CONFIG_HEADERS(config.h)
|
AC_CONFIG_HEADERS(config.h)
|
||||||
|
|
||||||
|
@ -48,9 +48,7 @@ AC_PREFIX_PROGRAM(nasm)
|
||||||
|
|
||||||
dnl Checks for programs.
|
dnl Checks for programs.
|
||||||
dnl Consider AC_USE_SYSTEM_EXTENSIONS if autoconf 2.61 is OK in the future
|
dnl Consider AC_USE_SYSTEM_EXTENSIONS if autoconf 2.61 is OK in the future
|
||||||
AC_GNU_SOURCE
|
AC_USE_SYSTEM_EXTENSIONS
|
||||||
AC_ISC_POSIX
|
|
||||||
AC_MINIX
|
|
||||||
AC_PROG_CC
|
AC_PROG_CC
|
||||||
AC_PROG_LN_S
|
AC_PROG_LN_S
|
||||||
AC_PROG_MAKE_SET
|
AC_PROG_MAKE_SET
|
||||||
|
@ -95,6 +93,13 @@ AC_CHECK_HEADERS(stdbool.h)
|
||||||
dnl Checks for typedefs, structures, and compiler characteristics.
|
dnl Checks for typedefs, structures, and compiler characteristics.
|
||||||
AC_C_CONST
|
AC_C_CONST
|
||||||
AC_TYPE_SIZE_T
|
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.
|
dnl Checks for library functions.
|
||||||
AC_SUBST(XOBJS)
|
AC_SUBST(XOBJS)
|
||||||
|
|
5
wsaa.h
5
wsaa.h
|
@ -4,10 +4,7 @@
|
||||||
#include "compiler.h"
|
#include "compiler.h"
|
||||||
#include "nasmlib.h"
|
#include "nasmlib.h"
|
||||||
|
|
||||||
/* XXX: only LITTLE_ENDIAN is actually needed here. The way these
|
#ifdef WORDS_LITTEENDIAN
|
||||||
macros is written, it does not require that unaligned references
|
|
||||||
are permitted. */
|
|
||||||
#if X86_MEMORY
|
|
||||||
|
|
||||||
#define WSAACHAR(s,v) \
|
#define WSAACHAR(s,v) \
|
||||||
do { \
|
do { \
|
||||||
|
|
Loading…
Reference in a new issue