From: Dmitry V. Levin Date: Mon, 14 Dec 2015 11:57:59 +0000 (+0000) Subject: Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN X-Git-Tag: v4.11~15 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=da126fbd77d3ead8f2866ffadd0d2a751f8e4755;p=strace Replace HAVE_LITTLE_ENDIAN_LONG_LONG with WORDS_BIGENDIAN * defs.h: Use WORDS_BIGENDIAN instead of HAVE_LITTLE_ENDIAN_LONG_LONG. * configure.ac (AC_LITTLE_ENDIAN_LONG_LONG): Remove. * m4/long_long.m4: Remove. --- diff --git a/configure.ac b/configure.ac index db704cc2..f591da5d 100644 --- a/configure.ac +++ b/configure.ac @@ -247,7 +247,6 @@ AC_CHECK_MEMBERS([struct sockaddr_in6.sin6_scope_id],,, [#include #include #include ]) -AC_LITTLE_ENDIAN_LONG_LONG AC_CHECK_FUNCS(m4_normalize([ fanotify_mark diff --git a/defs.h b/defs.h index 0538bcf5..1aca4e2d 100644 --- a/defs.h +++ b/defs.h @@ -582,12 +582,12 @@ extern int print_quoted_string(const char *, unsigned int, unsigned int); /* a refers to the lower numbered u_arg, * b refers to the higher numbered u_arg */ -#ifdef HAVE_LITTLE_ENDIAN_LONG_LONG +#ifdef WORDS_BIGENDIAN # define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))) + ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))) #else # define LONG_LONG(a,b) \ - ((long long)((unsigned long long)(unsigned)(b) | ((unsigned long long)(a)<<32))) + ((long long)((unsigned long long)(unsigned)(a) | ((unsigned long long)(b)<<32))) #endif extern int getllval(struct tcb *, unsigned long long *, int); extern int printllval(struct tcb *, const char *, int) diff --git a/m4/long_long.m4 b/m4/long_long.m4 deleted file mode 100644 index e6d22f0c..00000000 --- a/m4/long_long.m4 +++ /dev/null @@ -1,29 +0,0 @@ -dnl ### A macro to determine endianness of long long -AC_DEFUN([AC_LITTLE_ENDIAN_LONG_LONG], -[AC_MSG_CHECKING(for little endian long long) -AC_CACHE_VAL(ac_cv_have_little_endian_long_long, -[AC_RUN_IFELSE([AC_LANG_SOURCE([[ -int main () { - union { - long long ll; - int l [2]; - } u; - u.ll = 0x12345678; - if (u.l[0] == 0x12345678) - return 0; - return 1; -} -]])],[ac_cv_have_little_endian_long_long=yes],[ac_cv_have_little_endian_long_long=no],[ -if test "x$ac_cv_c_bigendian" = "xyes"; then - ac_cv_have_little_endian_long_long=no -else - ac_cv_have_little_endian_long_long=yes -fi -])]) -AC_MSG_RESULT($ac_cv_have_little_endian_long_long) -if test "$ac_cv_have_little_endian_long_long" = yes -then - AC_DEFINE([HAVE_LITTLE_ENDIAN_LONG_LONG], 1, -[Define if long long is little-endian.]) -fi -])