Get rid of TestBigEndian and AC_C_BIGENDIAN.

Get rid of CMake's TestBigEndian and Autotools' AC_C_BIGENDIAN checks in
favor of G_BYTE_ORDER. We use G_BYTE_ORDER elsewhere and TestBigEndian
is noticeably slow on Windows.

Change-Id: Idc1326294db9cbee8f6b6b11c2028fc4d19acbf0
Reviewed-on: https://code.wireshark.org/review/26462
Petri-Dish: Gerald Combs <gerald@wireshark.org>
Tested-by: Petri Dish Buildbot
Reviewed-by: Gerald Combs <gerald@wireshark.org>
This commit is contained in:
Gerald Combs 2018-03-13 10:15:25 -07:00
parent fa27833548
commit 246f0bc012
7 changed files with 7 additions and 18 deletions

View File

@ -1248,10 +1248,6 @@ endif()
include(ConfigureChecks.cmake) include(ConfigureChecks.cmake)
#Big or little endian ?
include(TestBigEndian)
test_big_endian(WORDS_BIGENDIAN)
# Global properties # Global properties
set_property(GLOBAL PROPERTY USE_FOLDERS ON) set_property(GLOBAL PROPERTY USE_FOLDERS ON)

View File

@ -351,10 +351,6 @@
/* Define if we have QtWinExtras */ /* Define if we have QtWinExtras */
/* #cmakedefine QT_WINEXTRAS_LIB 1 */ /* #cmakedefine QT_WINEXTRAS_LIB 1 */
/* Define to 1 if your processor stores words with the most significant byte
first (like Motorola and SPARC, unlike Intel and VAX). */
#cmakedefine WORDS_BIGENDIAN 1
/* Build androiddump with libpcap instead of wireshark stuff */ /* Build androiddump with libpcap instead of wireshark stuff */
#cmakedefine ANDROIDDUMP_USE_LIBPCAP 1 #cmakedefine ANDROIDDUMP_USE_LIBPCAP 1

View File

@ -2296,9 +2296,6 @@ AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
#include <sys/socket.h> #include <sys/socket.h>
#endif]) #endif])
# We must know our byte order
AC_C_BIGENDIAN
AC_REPLACE_FUNCS(getopt_long) AC_REPLACE_FUNCS(getopt_long)
dnl dnl
dnl Do we have optreset? dnl Do we have optreset?

View File

@ -1226,7 +1226,7 @@ tvb_get_ntohieee_double(tvbuff_t *tvb, const int offset)
} ieee_fp_union; } ieee_fp_union;
#endif #endif
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
ieee_fp_union.w[0] = tvb_get_ntohl(tvb, offset); ieee_fp_union.w[0] = tvb_get_ntohl(tvb, offset);
ieee_fp_union.w[1] = tvb_get_ntohl(tvb, offset+4); ieee_fp_union.w[1] = tvb_get_ntohl(tvb, offset+4);
#else #else
@ -1376,7 +1376,7 @@ tvb_get_letohieee_double(tvbuff_t *tvb, const int offset)
} ieee_fp_union; } ieee_fp_union;
#endif #endif
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
ieee_fp_union.w[0] = tvb_get_letohl(tvb, offset+4); ieee_fp_union.w[0] = tvb_get_letohl(tvb, offset+4);
ieee_fp_union.w[1] = tvb_get_letohl(tvb, offset); ieee_fp_union.w[1] = tvb_get_letohl(tvb, offset);
#else #else

View File

@ -291,7 +291,7 @@ typedef struct {
} hdr_ip_t; } hdr_ip_t;
static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0, static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0,
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
0x0a010101, 0x0a020202 0x0a010101, 0x0a020202
#else #else
0x0101010a, 0x0202020a 0x0101010a, 0x0202020a
@ -299,7 +299,7 @@ static hdr_ip_t HDR_IP = {0x45, 0, 0, 0x3412, 0, 0, 0xff, 0, 0,
}; };
/* Fixed IP address values */ /* Fixed IP address values */
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
#define IP_SRC 0x0a010101 #define IP_SRC 0x0a010101
#define IP_DST 0x0a020202 #define IP_DST 0x0a020202
#else #else

View File

@ -607,7 +607,7 @@ static gboolean s32write(wtap_dumper *wdh, const guint32 s32, int *err)
*---------------------------------------------------*/ *---------------------------------------------------*/
static gboolean s48write(wtap_dumper *wdh, const guint64 s48, int *err) static gboolean s48write(wtap_dumper *wdh, const guint64 s48, int *err)
{ {
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
guint16 s48_upper_le = GUINT16_SWAP_LE_BE((guint16) (s48 >> 32)); guint16 s48_upper_le = GUINT16_SWAP_LE_BE((guint16) (s48 >> 32));
guint32 s48_lower_le = GUINT32_SWAP_LE_BE((guint32) (s48 & 0xFFFFFFFF)); guint32 s48_lower_le = GUINT32_SWAP_LE_BE((guint32) (s48 & 0xFFFFFFFF));
#else #else

View File

@ -240,7 +240,7 @@ wtap_open_return_val netmon_open(wtap *wth, int *err, gchar **err_info)
GHashTable *comment_table, *process_info_table; GHashTable *comment_table, *process_info_table;
struct netmonrec_comment* comment_rec; struct netmonrec_comment* comment_rec;
gint64 file_size = wtap_file_size(wth, err); gint64 file_size = wtap_file_size(wth, err);
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
unsigned int i; unsigned int i;
#endif #endif
netmon_t *netmon; netmon_t *netmon;
@ -729,7 +729,7 @@ wtap_open_return_val netmon_open(wtap *wth, int *err, gchar **err_info)
netmon->process_info_table = process_info_table; netmon->process_info_table = process_info_table;
} }
#ifdef WORDS_BIGENDIAN #if G_BYTE_ORDER == G_BIG_ENDIAN
/* /*
* OK, now byte-swap the frame table. * OK, now byte-swap the frame table.
*/ */