From ba80efab017d71647b1f4027a8b1fa30390655fb Mon Sep 17 00:00:00 2001 From: Zuyi Hu Date: Fri, 6 Sep 2024 03:19:22 +0800 Subject: [PATCH] fix archlinux gcc 14 build failure issue MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. add strings.h to fix strcasecmp issue /home/hzy/build/PXView/libsigrok/strutil.c: In function ‘sr_parse_sizestring’: /home/hzy/build/PXView/libsigrok/strutil.c:343:19: error: implicit declaration of function ‘strcasecmp’; did you mean ‘g_strcasecmp’? [-Wimplicit-function-declaration] 343 | if (*s && strcasecmp(s, "Hz")) | ^~~~~~~~~~ | g_strcasecmp 2. add strings.h to fix strcasecmp issue /home/hzy/build/PXView/libsigrok/input/in_wav.c: In function ‘get_wav_header’: /home/hzy/build/PXView/libsigrok/input/in_wav.c:47:23: error: implicit declaration of function ‘strcasecmp’; did you mean ‘g_strcasecmp’? [-Wimplicit-function-declaration] 47 | if (l <= 4 || strcasecmp(filename + l - 4, ".wav")) | ^~~~~~~~~~ | g_strcasecmp 3. add sr_dslogic_option_value_to_code2 declaration to fix implicit function declaration issue /home/hzy/build/PXView/libsigrok/lib_main.c: In function ‘ds_dsl_option_value_to_code’: /home/hzy/build/PXView/libsigrok/lib_main.c:1022:24: error: implicit declaration of function ‘sr_dslogic_option_value_to_code2’; did you mean ‘sr_dslogic_option_value_to_code’? [-Wimplicit-function-declaration] 1022 | return sr_dslogic_option_value_to_code2(lib_ctx.actived_device_instance, config_id, value); | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ | sr_dslogic_option_value_to_code --- libsigrok/input/in_wav.c | 1 + libsigrok/lib_main.c | 1 + libsigrok/strutil.c | 1 + 3 files changed, 3 insertions(+) diff --git a/libsigrok/input/in_wav.c b/libsigrok/input/in_wav.c index 3758c6a..9ae63eb 100644 --- a/libsigrok/input/in_wav.c +++ b/libsigrok/input/in_wav.c @@ -24,6 +24,7 @@ #include #include #include +#include #include "../log.h" #include diff --git a/libsigrok/lib_main.c b/libsigrok/lib_main.c index 3712108..c5834a9 100644 --- a/libsigrok/lib_main.c +++ b/libsigrok/lib_main.c @@ -82,6 +82,7 @@ static void make_demo_device_to_list(); static void process_attach_event(int isEvent); static struct libusb_device* get_new_attached_usb_device(); static struct libusb_device* get_new_detached_usb_device(); +extern SR_PRIV int sr_dslogic_option_value_to_code2(const struct sr_dev_inst *sdi, int config_id, const char *value); static struct sr_lib_context lib_ctx = { .event_callback = NULL, diff --git a/libsigrok/strutil.c b/libsigrok/strutil.c index 837e4a0..97062b3 100644 --- a/libsigrok/strutil.c +++ b/libsigrok/strutil.c @@ -21,6 +21,7 @@ #include "libsigrok-internal.h" #include #include +#include #include #include "log.h"