From d21295f9a6da65420254afba0bb8a64cb4155947 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20Valverde?= Date: Thu, 4 Aug 2016 12:11:09 +0100 Subject: [PATCH] Bump GLib minimum required version to 2.22.0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Change-Id: I0ab85be8090f234f9ca10914063f97f13c894413 Reviewed-on: https://code.wireshark.org/review/16879 Petri-Dish: João Valverde Reviewed-by: Anders Broman Tested-by: Petri Dish Buildbot Reviewed-by: João Valverde --- CMakeLists.txt | 2 +- configure.ac | 2 +- epan/CMakeLists.txt | 1 - epan/Makefile.am | 1 - epan/dissectors/packet-infiniband.c | 1 - epan/dissectors/packet-mbim.c | 1 - epan/dissectors/packet-rsvd.c | 1 - epan/dissectors/packet-rtitcp.c | 1 - epan/g_int64_hash_routines.c | 76 ----------------------------- epan/g_int64_hash_routines.h | 45 ----------------- epan/in_cksum.c | 4 -- 11 files changed, 2 insertions(+), 133 deletions(-) delete mode 100644 epan/g_int64_hash_routines.c delete mode 100644 epan/g_int64_hash_routines.h diff --git a/CMakeLists.txt b/CMakeLists.txt index 488e451e72..a4d7e55c3e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -651,7 +651,7 @@ set(PACKAGELIST Gettext M Git GLIB2 GMODULE2 GTHREAD2 LEX YACC Perl SED SH Pytho set(LEX_REQUIRED TRUE) set(GLIB2_REQUIRED TRUE) set(GLIB2_FIND_REQUIRED TRUE) -set(GLIB2_MIN_VERSION 2.14.0) +set(GLIB2_MIN_VERSION 2.22.0) set(GTHREAD2_REQUIRED TRUE) set(PythonInterp_FIND_VERSION 2) set(Python_ADDITIONAL_VERSIONS 3) diff --git a/configure.ac b/configure.ac index db0066a5c1..82f91ba163 100644 --- a/configure.ac +++ b/configure.ac @@ -1176,7 +1176,7 @@ else AC_MSG_RESULT(no) fi -GLIB_MIN_VERSION=2.16.0 +GLIB_MIN_VERSION=2.22.0 AC_SUBST(GLIB_MIN_VERSION) # GLib checks; we require GLib $GLIB_MIN_VERSION or later, and require gmodule # support, as we need that for dynamically loading plugins. diff --git a/epan/CMakeLists.txt b/epan/CMakeLists.txt index 4c06ada5c6..540b480fac 100644 --- a/epan/CMakeLists.txt +++ b/epan/CMakeLists.txt @@ -120,7 +120,6 @@ set(LIBWIRESHARK_FILES frame_data.c frame_data_sequence.c funnel.c - g_int64_hash_routines.c geoip_db.c golay.c guid-utils.c diff --git a/epan/Makefile.am b/epan/Makefile.am index 4dab5675bf..3b0176c71d 100644 --- a/epan/Makefile.am +++ b/epan/Makefile.am @@ -82,7 +82,6 @@ LIBWIRESHARK_SRC = \ frame_data.c \ frame_data_sequence.c \ funnel.c \ - g_int64_hash_routines.c \ geoip_db.c \ golay.c \ guid-utils.c \ diff --git a/epan/dissectors/packet-infiniband.c b/epan/dissectors/packet-infiniband.c index 961a610ca5..339a401712 100644 --- a/epan/dissectors/packet-infiniband.c +++ b/epan/dissectors/packet-infiniband.c @@ -31,7 +31,6 @@ #include #include #include -#include #include #include "packet-infiniband.h" diff --git a/epan/dissectors/packet-mbim.c b/epan/dissectors/packet-mbim.c index 1d1935e90e..23fdf087f7 100644 --- a/epan/dissectors/packet-mbim.c +++ b/epan/dissectors/packet-mbim.c @@ -35,7 +35,6 @@ #include #include #include -#include #include "packet-gsm_a_common.h" #include "packet-gsm_map.h" diff --git a/epan/dissectors/packet-rsvd.c b/epan/dissectors/packet-rsvd.c index 05115c2d6e..c64a1a7533 100644 --- a/epan/dissectors/packet-rsvd.c +++ b/epan/dissectors/packet-rsvd.c @@ -30,7 +30,6 @@ #include #include -#include #include "packet-scsi.h" void proto_reg_handoff_rsvd(void); diff --git a/epan/dissectors/packet-rtitcp.c b/epan/dissectors/packet-rtitcp.c index 62bd652882..0f3a3f5341 100755 --- a/epan/dissectors/packet-rtitcp.c +++ b/epan/dissectors/packet-rtitcp.c @@ -37,7 +37,6 @@ #include #include #include -#include #include #define RTITCP_MAGIC_NUMBER 0xdd54dd55 diff --git a/epan/g_int64_hash_routines.c b/epan/g_int64_hash_routines.c deleted file mode 100644 index 6ffbf9789f..0000000000 --- a/epan/g_int64_hash_routines.c +++ /dev/null @@ -1,76 +0,0 @@ -/* g_int64_hash_routines.h - * Definition of gint64 hash table routines absent from GLib < 2.22 - * - * From: - * - * GLIB - Library of useful routines for C programming - * Copyright (C) 1995-1997 Peter Mattis, Spencer Kimball and Josh MacDonald - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public - * License as published by the Free Software Foundation; either - * version 2 of the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -/* - * Modified by the GLib Team and others 1997-2000. See the AUTHORS - * file for a list of people on the GLib Team. See the ChangeLog - * files for a list of changes. These files are distributed with - * GLib at ftp://ftp.gtk.org/pub/gtk/. - */ - -#include - -#if !GLIB_CHECK_VERSION(2,22,0) -/** - * g_int64_equal: - * @v1: a pointer to a #gint64 key - * @v2: a pointer to a #gint64 key to compare with @v1 - * - * Compares the two #gint64 values being pointed to and returns - * %TRUE if they are equal. - * It can be passed to g_hash_table_new() as the @key_equal_func - * parameter, when using non-%NULL pointers to 64-bit integers as keys in a - * #GHashTable. - * - * Returns: %TRUE if the two keys match. - * - * Since: 2.22 - */ -gboolean -g_int64_equal (gconstpointer v1, - gconstpointer v2) -{ - return *((const gint64*) v1) == *((const gint64*) v2); -} - -/** - * g_int64_hash: - * @v: a pointer to a #gint64 key - * - * Converts a pointer to a #gint64 to a hash value. - * - * It can be passed to g_hash_table_new() as the @hash_func parameter, - * when using non-%NULL pointers to 64-bit integer values as keys in a - * #GHashTable. - * - * Returns: a hash value corresponding to the key. - * - * Since: 2.22 - */ -guint -g_int64_hash (gconstpointer v) -{ - return (guint) *(const gint64*) v; -} - -#endif /* !GLIB_CHECK_VERSION(2,22,0) */ diff --git a/epan/g_int64_hash_routines.h b/epan/g_int64_hash_routines.h deleted file mode 100644 index 9388f56a1d..0000000000 --- a/epan/g_int64_hash_routines.h +++ /dev/null @@ -1,45 +0,0 @@ -/* g_int64_hash_routines.h - * Declaration of gint64 hash table routines absent from GLib < 2.22 - * - * This program is free software; you can redistribute it and/or - * modify it under the terms of the GNU General Public License - * as published by the Free Software Foundation; either version 2 - * of the License, or (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program; if not, write to the Free Software - * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. - */ - -#ifndef __G_INT64_HASH_ROUTINES_H__ -#define __G_INT64_HASH_ROUTINES_H__ - -#ifdef __cplusplus -extern "C" { -#endif /* __cplusplus */ - -#include - -#include "ws_symbol_export.h" - -/* g_int64_hash, g_int64_equal are defined starting glib 2.22 - otherwise, - we have to provide them ourselves */ -#if !GLIB_CHECK_VERSION(2,22,0) -WS_DLL_PUBLIC guint -g_int64_hash (gconstpointer v); - -WS_DLL_PUBLIC gboolean -g_int64_equal (gconstpointer v1, - gconstpointer v2); -#endif /* !GLIB_CHECK_VERSION(2,22,0) */ - -#ifdef __cplusplus -} -#endif /* __cplusplus */ - -#endif /* g_int64_hash_routines.h */ diff --git a/epan/in_cksum.c b/epan/in_cksum.c index 62c24a4766..e40d968b42 100644 --- a/epan/in_cksum.c +++ b/epan/in_cksum.c @@ -89,11 +89,7 @@ in_cksum(const vec_t *vec, int veclen) /* * Force to even boundary. */ -#if GLIB_CHECK_VERSION(2,18,0) if ((1 & (gintptr)w) && (mlen > 0)) { -#else - if ((1 & (unsigned long) w) && (mlen > 0)) { -#endif /* GLIB_CHECK_VERSION(2,18,0) */ REDUCE; sum <<= 8; s_util.c[0] = *(const guint8 *)w;