forked from osmocom/wireshark
glib: Get rid of GLIB_CHECK_VERSION as we now require 2.32.0
Change-Id: Ie95cf37f9cd283545693e290340a7489cc989c95 Reviewed-on: https://code.wireshark.org/review/26970 Petri-Dish: Anders Broman <a.broman58@gmail.com> Tested-by: Petri Dish Buildbot Reviewed-by: Anders Broman <a.broman58@gmail.com>
This commit is contained in:
parent
ccff21854d
commit
bb81bef535
51
dumpcap.c
51
dumpcap.c
|
@ -118,9 +118,6 @@
|
|||
#endif
|
||||
#endif
|
||||
|
||||
/* for g_thread_new */
|
||||
#include "wsutil/glib-compat.h"
|
||||
|
||||
#ifdef DEBUG_CHILD_DUMPCAP
|
||||
FILE *debug_log; /* for logging debug messages to */
|
||||
/* a file if DEBUG_CHILD_DUMPCAP */
|
||||
|
@ -2049,9 +2046,6 @@ pcap_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int errms
|
|||
enum { PD_REC_HDR_READ, PD_DATA_READ, PD_PIPE_EOF, PD_PIPE_ERR,
|
||||
PD_ERR } result;
|
||||
#ifdef _WIN32
|
||||
#if !GLIB_CHECK_VERSION(2,31,18)
|
||||
GTimeVal wait_time;
|
||||
#endif
|
||||
gpointer q_status;
|
||||
wchar_t *err_str;
|
||||
#endif
|
||||
|
@ -2101,13 +2095,7 @@ pcap_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int errms
|
|||
}
|
||||
#ifdef _WIN32
|
||||
else {
|
||||
#if GLIB_CHECK_VERSION(2,31,18)
|
||||
q_status = g_async_queue_timeout_pop(pcap_src->cap_pipe_done_q, PIPE_READ_TIMEOUT);
|
||||
#else
|
||||
g_get_current_time(&wait_time);
|
||||
g_time_val_add(&wait_time, PIPE_READ_TIMEOUT);
|
||||
q_status = g_async_queue_timed_pop(pcap_src->cap_pipe_done_q, &wait_time);
|
||||
#endif
|
||||
if (pcap_src->cap_pipe_err == PIPEOF) {
|
||||
result = PD_PIPE_EOF;
|
||||
break;
|
||||
|
@ -2163,13 +2151,7 @@ pcap_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int errms
|
|||
#ifdef _WIN32
|
||||
else {
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,31,18)
|
||||
q_status = g_async_queue_timeout_pop(pcap_src->cap_pipe_done_q, PIPE_READ_TIMEOUT);
|
||||
#else
|
||||
g_get_current_time(&wait_time);
|
||||
g_time_val_add(&wait_time, PIPE_READ_TIMEOUT);
|
||||
q_status = g_async_queue_timed_pop(pcap_src->cap_pipe_done_q, &wait_time);
|
||||
#endif /* GLIB_CHECK_VERSION(2,31,18) */
|
||||
if (pcap_src->cap_pipe_err == PIPEOF) {
|
||||
result = PD_PIPE_EOF;
|
||||
break;
|
||||
|
@ -2295,9 +2277,6 @@ pcapng_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int err
|
|||
enum { PD_REC_HDR_READ, PD_DATA_READ, PD_PIPE_EOF, PD_PIPE_ERR,
|
||||
PD_ERR } result;
|
||||
#ifdef _WIN32
|
||||
#if !GLIB_CHECK_VERSION(2,31,18)
|
||||
GTimeVal wait_time;
|
||||
#endif
|
||||
gpointer q_status;
|
||||
wchar_t *err_str;
|
||||
#endif
|
||||
|
@ -2338,13 +2317,7 @@ pcapng_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int err
|
|||
}
|
||||
#ifdef _WIN32
|
||||
else {
|
||||
#if GLIB_CHECK_VERSION(2,31,18)
|
||||
q_status = g_async_queue_timeout_pop(pcap_src->cap_pipe_done_q, PIPE_READ_TIMEOUT);
|
||||
#else
|
||||
g_get_current_time(&wait_time);
|
||||
g_time_val_add(&wait_time, PIPE_READ_TIMEOUT);
|
||||
q_status = g_async_queue_timed_pop(pcap_src->cap_pipe_done_q, &wait_time);
|
||||
#endif
|
||||
if (pcap_src->cap_pipe_err == PIPEOF) {
|
||||
result = PD_PIPE_EOF;
|
||||
break;
|
||||
|
@ -2394,13 +2367,7 @@ pcapng_pipe_dispatch(loop_data *ld, capture_src *pcap_src, char *errmsg, int err
|
|||
#ifdef _WIN32
|
||||
else {
|
||||
|
||||
#if GLIB_CHECK_VERSION(2,31,18)
|
||||
q_status = g_async_queue_timeout_pop(pcap_src->cap_pipe_done_q, PIPE_READ_TIMEOUT);
|
||||
#else
|
||||
g_get_current_time(&wait_time);
|
||||
g_time_val_add(&wait_time, PIPE_READ_TIMEOUT);
|
||||
q_status = g_async_queue_timed_pop(pcap_src->cap_pipe_done_q, &wait_time);
|
||||
#endif /* GLIB_CHECK_VERSION(2,31,18) */
|
||||
if (pcap_src->cap_pipe_err == PIPEOF) {
|
||||
result = PD_PIPE_EOF;
|
||||
break;
|
||||
|
@ -2617,12 +2584,8 @@ capture_loop_open_input(capture_options *capture_opts, loop_data *ld,
|
|||
pcap_src->cap_pipe_state = STATE_EXPECT_REC_HDR;
|
||||
pcap_src->cap_pipe_err = PIPOK;
|
||||
#ifdef _WIN32
|
||||
#if GLIB_CHECK_VERSION(2,31,0)
|
||||
pcap_src->cap_pipe_read_mtx = g_malloc(sizeof(GMutex));
|
||||
g_mutex_init(pcap_src->cap_pipe_read_mtx);
|
||||
#else
|
||||
pcap_src->cap_pipe_read_mtx = g_mutex_new();
|
||||
#endif
|
||||
pcap_src->cap_pipe_pending_q = g_async_queue_new();
|
||||
pcap_src->cap_pipe_done_q = g_async_queue_new();
|
||||
#endif
|
||||
|
@ -3656,18 +3619,9 @@ capture_loop_start(capture_options *capture_opts, gboolean *stats_known, struct
|
|||
/* dispatch incoming packets */
|
||||
if (use_threads) {
|
||||
pcap_queue_element *queue_element;
|
||||
#if GLIB_CHECK_VERSION(2,31,18)
|
||||
|
||||
g_async_queue_lock(pcap_queue);
|
||||
queue_element = (pcap_queue_element *)g_async_queue_timeout_pop_unlocked(pcap_queue, WRITER_THREAD_TIMEOUT);
|
||||
#else
|
||||
GTimeVal write_thread_time;
|
||||
|
||||
g_get_current_time(&write_thread_time);
|
||||
g_time_val_add(&write_thread_time, WRITER_THREAD_TIMEOUT);
|
||||
g_async_queue_lock(pcap_queue);
|
||||
queue_element = (pcap_queue_element *)g_async_queue_timed_pop_unlocked(pcap_queue, &write_thread_time);
|
||||
#endif
|
||||
if (queue_element) {
|
||||
if (queue_element->pcap_src->from_pcapng) {
|
||||
pcap_queue_bytes -= queue_element->u.bh.block_total_length;
|
||||
|
@ -4570,11 +4524,6 @@ main(int argc, char *argv[])
|
|||
/* Initialize the pcaps list */
|
||||
global_ld.pcaps = g_array_new(FALSE, FALSE, sizeof(capture_src *));
|
||||
|
||||
#if !GLIB_CHECK_VERSION(2,31,0)
|
||||
/* Initialize the thread system */
|
||||
g_thread_init(NULL);
|
||||
#endif
|
||||
|
||||
#ifdef _WIN32
|
||||
/* Load wpcap if possible. Do this before collecting the run-time version information */
|
||||
load_wpcap();
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#define ARRAY_RESERVED_SIZE 2048
|
||||
#define STRING_RESERVED_SIZE (300 * 1024)
|
||||
|
|
|
@ -37,7 +37,6 @@
|
|||
#include <epan/proto_data.h>
|
||||
|
||||
#include <wsutil/str_util.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include "packet-tcp.h"
|
||||
#include "packet-dcerpc.h"
|
||||
#include "packet-dcerpc-nt.h"
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <glib.h>
|
||||
|
||||
#include <epan/expert.h>
|
||||
#include <epan/packet.h>
|
||||
#include <wsutil/base32.h>
|
||||
|
||||
|
@ -43,7 +42,6 @@ static int hf_fc00_authenticator = -1;
|
|||
static int hf_fc00_temp_publicy_key = -1;
|
||||
static int hf_fc00_payload = -1;
|
||||
|
||||
static expert_field ei_fc00_chksum_unsupported = EI_INIT;
|
||||
|
||||
/* Cjdns constants */
|
||||
#define SESSION_STATE_OFF 0
|
||||
|
@ -123,7 +121,6 @@ dissect_cryptoauth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
|
|||
proto_tree_add_item(fc00_tree, hf_fc00_random_nonce, tvb,
|
||||
NONCE_OFF, NONCE_LEN, ENC_NA);
|
||||
|
||||
#if GLIB_CHECK_VERSION(2, 36, 0) /* sha512 support was added in glib 2.36 */
|
||||
if (fc00_tree)
|
||||
{
|
||||
GChecksum *hash = g_checksum_new(G_CHECKSUM_SHA512);
|
||||
|
@ -153,9 +150,6 @@ dissect_cryptoauth(tvbuff_t *tvb, packet_info *pinfo, proto_tree *tree, void *da
|
|||
|
||||
proto_tree_add_ipv6(key_tree, hf_fc00_ip_address, tvb, PUBLIC_KEY_OFF, PUBLIC_KEY_LEN, (ws_in6_addr*)ip_buf);
|
||||
}
|
||||
#else
|
||||
proto_tree_add_expert(fc00_tree, pinfo, &ei_fc00_chksum_unsupported, tvb, PUBLIC_KEY_OFF, PUBLIC_KEY_LEN);
|
||||
#endif
|
||||
|
||||
proto_tree_add_item(fc00_tree, hf_fc00_authenticator, tvb,
|
||||
POLY_AUTH_OFF, POLY_AUTH_LEN, ENC_NA);
|
||||
|
@ -263,27 +257,17 @@ proto_register_fc00(void)
|
|||
}
|
||||
};
|
||||
|
||||
static ei_register_info ei[] = {
|
||||
{ &ei_fc00_chksum_unsupported,
|
||||
{ "fc00.chksum_unsupported", PI_DECRYPTION, PI_NOTE,
|
||||
"checksum calculation is not supported",
|
||||
EXPFILL }}
|
||||
};
|
||||
|
||||
static gint *ett[] = {
|
||||
&ett_fc00,
|
||||
&ett_fc00_auth,
|
||||
&ett_fc00_key
|
||||
};
|
||||
|
||||
expert_module_t *expert_fc00;
|
||||
|
||||
proto_fc00 = proto_register_protocol("Fc00 CryptoAuth", "Fc00", "fc00");
|
||||
|
||||
proto_register_field_array(proto_fc00, hf, array_length(hf));
|
||||
proto_register_subtree_array(ett, array_length(ett));
|
||||
expert_fc00 = expert_register_protocol(proto_fc00);
|
||||
expert_register_field_array(expert_fc00, ei, array_length(ei));
|
||||
}
|
||||
|
||||
void
|
||||
|
|
|
@ -26,7 +26,6 @@
|
|||
#include "packet-zbee-nwk.h"
|
||||
#include "packet-zbee-aps.h" /* for ZBEE_APS_CMD_KEY_LENGTH */
|
||||
#include "packet-zbee-security.h"
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
/*************************/
|
||||
/* Function Declarations */
|
||||
|
|
|
@ -22,7 +22,6 @@
|
|||
|
||||
#include <version_info.h>
|
||||
#include <wsutil/report_message.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#include <epan/exceptions.h>
|
||||
|
||||
|
@ -191,13 +190,6 @@ epan_init(void (*register_all_protocols_func)(register_cb cb, gpointer client_da
|
|||
* GLib 2.24, multiple invocations are allowed. Check for an earlier
|
||||
* invocation just in case.
|
||||
*/
|
||||
#if !GLIB_CHECK_VERSION(2,31,0)
|
||||
# if !GLIB_CHECK_VERSION(2,24,0)
|
||||
if (!g_thread_get_initialized())
|
||||
# endif
|
||||
g_thread_init(NULL);
|
||||
#endif
|
||||
|
||||
/* initialize memory allocation subsystem */
|
||||
wmem_init();
|
||||
|
||||
|
|
|
@ -30,7 +30,6 @@
|
|||
#include <version_info.h>
|
||||
#include <wsutil/utf8_entities.h>
|
||||
#include <ftypes/ftypes-int.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#define PDML_VERSION "0"
|
||||
#define PSML_VERSION "0"
|
||||
|
|
|
@ -45,7 +45,6 @@
|
|||
|
||||
#include <wsutil/ws_printf.h> /* ws_debug_printf/ws_g_warning */
|
||||
#include <wsutil/crash_info.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
/* Ptvcursor limits */
|
||||
#define SUBTREE_ONCE_ALLOCATION_NUMBER 8
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include "ws_attributes.h"
|
||||
|
||||
#include <glib.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include "epan/dissectors/dissectors.h"
|
||||
|
||||
static const char *cur_cb_name = NULL;
|
||||
|
|
|
@ -228,21 +228,9 @@ sequence_analysis_list_free(seq_analysis_info_t *sainfo)
|
|||
|
||||
/* free the graph data items */
|
||||
|
||||
#if GLIB_CHECK_VERSION (2, 32, 0)
|
||||
if (sainfo->items != NULL)
|
||||
g_queue_free_full(sainfo->items, sequence_analysis_item_free);
|
||||
sainfo->items = g_queue_new();
|
||||
#else
|
||||
{
|
||||
GList *list = g_queue_peek_nth_link(sainfo->items, 0);
|
||||
while (list)
|
||||
{
|
||||
sequence_analysis_item_free(list->data);
|
||||
list = g_list_next(list);
|
||||
}
|
||||
g_queue_clear(sainfo->items);
|
||||
}
|
||||
#endif
|
||||
|
||||
if (NULL != sainfo->ht) {
|
||||
g_hash_table_remove_all(sainfo->ht);
|
||||
|
@ -368,12 +356,7 @@ static void overwrite (GString *gstr, char *text_to_insert, guint32 p1, guint32
|
|||
if (len > ins_len) {
|
||||
len = ins_len;
|
||||
} else if (len < ins_len) {
|
||||
#if GLIB_CHECK_VERSION(2,30,0)
|
||||
ins_str = g_utf8_substring(text_to_insert, 0, len);
|
||||
#else
|
||||
gchar *end = g_utf8_offset_to_pointer(text_to_insert, len);
|
||||
ins_str = g_strndup(text_to_insert, end - text_to_insert);
|
||||
#endif
|
||||
}
|
||||
|
||||
if (!ins_str) ins_str = g_strdup(text_to_insert);
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include <epan/dfilter/dfilter.h>
|
||||
#include <epan/tap.h>
|
||||
#include <wsutil/ws_printf.h> /* ws_g_warning */
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
static gboolean tapping_is_active=FALSE;
|
||||
|
||||
|
|
1
extcap.c
1
extcap.c
|
@ -39,7 +39,6 @@
|
|||
|
||||
#include "ui/iface_toolbar.h"
|
||||
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/filesystem.h>
|
||||
#include <wsutil/ws_pipe.h>
|
||||
|
|
|
@ -16,7 +16,6 @@
|
|||
#include <wsutil/interface.h>
|
||||
#include <wsutil/strtoi.h>
|
||||
#include <wsutil/filesystem.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include <extcap/ssh-base.h>
|
||||
#include <writecap/pcapio.h>
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/strtoi.h>
|
||||
#include <wsutil/filesystem.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#include <errno.h>
|
||||
#include <string.h>
|
||||
|
|
|
@ -62,7 +62,6 @@
|
|||
|
||||
#include <epan/maxmind_db.h>
|
||||
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include <wsutil/pint.h>
|
||||
#include <wsutil/strtoi.h>
|
||||
|
||||
|
|
|
@ -363,9 +363,6 @@ main(int argc, char *argv[])
|
|||
#ifdef _WIN32
|
||||
arg_list_utf_16to8(argc, argv);
|
||||
create_app_running_mutex();
|
||||
#if !GLIB_CHECK_VERSION(2,31,0)
|
||||
g_thread_init(NULL);
|
||||
#endif
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
|
|
7
tshark.c
7
tshark.c
|
@ -754,9 +754,6 @@ main(int argc, char *argv[])
|
|||
#ifdef _WIN32
|
||||
arg_list_utf_16to8(argc, argv);
|
||||
create_app_running_mutex();
|
||||
#if !GLIB_CHECK_VERSION(2,31,0)
|
||||
g_thread_init(NULL);
|
||||
#endif
|
||||
#endif /* _WIN32 */
|
||||
|
||||
/*
|
||||
|
@ -2325,12 +2322,8 @@ pipe_input_set_handler(gint source, gpointer user_data, ws_process_id *child_pro
|
|||
pipe_input.input_cb = input_cb;
|
||||
|
||||
#ifdef _WIN32
|
||||
#if GLIB_CHECK_VERSION(2,31,0)
|
||||
pipe_input.callback_running = g_malloc(sizeof(GMutex));
|
||||
g_mutex_init(pipe_input.callback_running);
|
||||
#else
|
||||
pipe_input.callback_running = g_mutex_new();
|
||||
#endif
|
||||
/* Tricky to use pipes in win9x, as no concept of wait. NT can
|
||||
do this but that doesn't cover all win32 platforms. GTK can do
|
||||
this but doesn't seem to work over processes. Attempt to do
|
||||
|
|
|
@ -17,7 +17,6 @@
|
|||
|
||||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/filesystem.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
#include <wsutil/report_message.h>
|
||||
|
||||
#include "ui/filter_files.h"
|
||||
|
|
|
@ -12,7 +12,6 @@
|
|||
#include <stdio.h>
|
||||
#include <string.h>
|
||||
#include <glib.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#define ARRAY_RESERVED_SIZE 128
|
||||
#define STRING_RESERVED_SIZE (8 * 1024)
|
||||
|
|
|
@ -23,7 +23,6 @@
|
|||
#include "ui/recent.h"
|
||||
|
||||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
static GList *current_profiles = NULL;
|
||||
static GList *edited_profiles = NULL;
|
||||
|
|
|
@ -41,12 +41,8 @@ CompiledFilterOutput::CompiledFilterOutput(QWidget *parent, QStringList &intList
|
|||
close_bt->setDefault(true);
|
||||
|
||||
interface_list_ = ui->interfaceList;
|
||||
#if GLIB_CHECK_VERSION(2,31,0)
|
||||
pcap_compile_mtx = g_new(GMutex,1);
|
||||
g_mutex_init(pcap_compile_mtx);
|
||||
#else
|
||||
pcap_compile_mtx = g_mutex_new();
|
||||
#endif
|
||||
#ifdef HAVE_LIBPCAP
|
||||
compileFilter();
|
||||
#endif
|
||||
|
|
|
@ -28,7 +28,6 @@
|
|||
#include "ui/simple_dialog.h"
|
||||
|
||||
#include <wsutil/file_util.h>
|
||||
#include <wsutil/glib-compat.h>
|
||||
|
||||
#define RECENT_KEY_MAIN_TOOLBAR_SHOW "gui.toolbar_main_show"
|
||||
#define RECENT_KEY_FILTER_TOOLBAR_SHOW "gui.filter_toolbar_show"
|
||||
|
|
Loading…
Reference in New Issue