aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGerald Combs <gerald@wireshark.org>2018-03-13 10:15:25 -0700
committerGerald Combs <gerald@wireshark.org>2018-03-13 19:09:36 +0000
commit246f0bc0125eb2137781f5f8bfad783a2f7ac4cd (patch)
treeab379a95c861f64072d1099fb6ea687c639f6c45
parentfa278335483da207150f8680811ad5f9545ab57d (diff)
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>
-rw-r--r--CMakeLists.txt4
-rw-r--r--cmakeconfig.h.in4
-rw-r--r--configure.ac3
-rw-r--r--epan/tvbuff.c4
-rw-r--r--text2pcap.c4
-rw-r--r--wiretap/lanalyzer.c2
-rw-r--r--wiretap/netmon.c4
7 files changed, 7 insertions, 18 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index bb9097037f..d1f18da493 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -1248,10 +1248,6 @@ endif()
include(ConfigureChecks.cmake)
-#Big or little endian ?
-include(TestBigEndian)
-test_big_endian(WORDS_BIGENDIAN)
-
# Global properties
set_property(GLOBAL PROPERTY USE_FOLDERS ON)
diff --git a/cmakeconfig.h.in b/cmakeconfig.h.in
index 92402901ae..e5f12e3f49 100644
--- a/cmakeconfig.h.in
+++ b/cmakeconfig.h.in
@@ -351,10 +351,6 @@
/* Define if we have QtWinExtras */
/* #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 */
#cmakedefine ANDROIDDUMP_USE_LIBPCAP 1
diff --git a/configure.ac b/configure.ac
index f28a728217..bee5ad54b0 100644
--- a/configure.ac
+++ b/configure.ac
@@ -2296,9 +2296,6 @@ AC_CHECK_MEMBERS([struct sockaddr.sa_len],,,
#include <sys/socket.h>
#endif])
-# We must know our byte order
-AC_C_BIGENDIAN
-
AC_REPLACE_FUNCS(getopt_long)
dnl
dnl Do we have optreset?
diff --git a/epan/tvbuff.c b/epan/tvbuff.c
index facddc02d6..f6047f9f60 100644
--- a/epan/tvbuff.c
+++ b/epan/tvbuff.c
@@ -1226,7 +1226,7 @@ tvb_get_ntohieee_double(tvbuff_t *tvb, const int offset)
} ieee_fp_union;
#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[1] = tvb_get_ntohl(tvb, offset+4);
#else
@@ -1376,7 +1376,7 @@ tvb_get_letohieee_double(tvbuff_t *tvb, const int offset)
} ieee_fp_union;
#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[1] = tvb_get_letohl(tvb, offset);
#else
diff --git a/text2pcap.c b/text2pcap.c
index 2aea8e78e9..a5cb5b263d 100644
--- a/text2pcap.c
+++ b/text2pcap.c
@@ -291,7 +291,7 @@ typedef struct {
} hdr_ip_t;
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
#else
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 */
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
#define IP_SRC 0x0a010101
#define IP_DST 0x0a020202
#else
diff --git a/wiretap/lanalyzer.c b/wiretap/lanalyzer.c
index 00dbfa9c0c..f283c9bc1c 100644
--- a/wiretap/lanalyzer.c
+++ b/wiretap/lanalyzer.c
@@ -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)
{
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
guint16 s48_upper_le = GUINT16_SWAP_LE_BE((guint16) (s48 >> 32));
guint32 s48_lower_le = GUINT32_SWAP_LE_BE((guint32) (s48 & 0xFFFFFFFF));
#else
diff --git a/wiretap/netmon.c b/wiretap/netmon.c
index 6d365263a3..6acf402c40 100644
--- a/wiretap/netmon.c
+++ b/wiretap/netmon.c
@@ -240,7 +240,7 @@ wtap_open_return_val netmon_open(wtap *wth, int *err, gchar **err_info)
GHashTable *comment_table, *process_info_table;
struct netmonrec_comment* comment_rec;
gint64 file_size = wtap_file_size(wth, err);
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
unsigned int i;
#endif
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;
}
-#ifdef WORDS_BIGENDIAN
+#if G_BYTE_ORDER == G_BIG_ENDIAN
/*
* OK, now byte-swap the frame table.
*/