libdbi-drivers: fix compilation with GCC14
authorRosen Penev <rosenp@gmail.com>
Tue, 12 Nov 2024 00:24:35 +0000 (16:24 -0800)
committerRosen Penev <rosenp@gmail.com>
Sat, 16 Nov 2024 01:04:57 +0000 (17:04 -0800)
Patch from Alpine Linux.

Signed-off-by: Rosen Penev <rosenp@gmail.com>
libs/libdbi-drivers/Makefile
libs/libdbi-drivers/patches/010-gcc14.patch [new file with mode: 0644]

index 1dc57a909041368056fc07d45c9d4245c4306c2e..e8e13f05671c4f822189bd7df5b5c7489250cc8c 100644 (file)
@@ -9,7 +9,7 @@ include $(TOPDIR)/rules.mk
 
 PKG_NAME:=libdbi-drivers
 PKG_VERSION:=0.9.0
-PKG_RELEASE:=2
+PKG_RELEASE:=3
 
 PKG_SOURCE:=$(PKG_NAME)-$(PKG_VERSION).tar.gz
 PKG_SOURCE_URL:=@SF/libdbi-drivers
diff --git a/libs/libdbi-drivers/patches/010-gcc14.patch b/libs/libdbi-drivers/patches/010-gcc14.patch
new file mode 100644 (file)
index 0000000..4a5a1d7
--- /dev/null
@@ -0,0 +1,49 @@
+Patch-Source-1: https://sourceforge.net/p/libdbi-drivers/bugs/27/attachment/libdbi-drivers-sys-wait.patch
+Patch-Source-2: https://sourceforge.net/p/libdbi-drivers/bugs/28/attachment/libdbi-drivers-c99.patch
+--
+--- a/tests/cgreen/src/unit.c
++++ b/tests/cgreen/src/unit.c
+@@ -9,6 +9,7 @@
+ #include <stdarg.h>
+ #include <unistd.h>
+ #include <signal.h>
++#include <sys/wait.h>
+ enum {test_function, test_suite};
+--- a/tests/cgreen/src/constraint.c
++++ b/tests/cgreen/src/constraint.c
+@@ -22,8 +22,7 @@ static double unbox_double(intptr_t box)
+ static double as_double(intptr_t box);
+ static int compare_using_matcher(Constraint *constraint, intptr_t actual);
+-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t actual, const char *test_file, int test_line, TestReporter *reporter);
+-
++static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter);
+ void destroy_constraint(void *abstract) {
+     Constraint *constraint = (Constraint *)abstract;
+@@ -164,11 +163,11 @@ static void test_want_double(Constraint
+ }
+ static int compare_using_matcher(Constraint *constraint, intptr_t actual) {
+-      int (*matches)(const void*) = constraint->expected;
+-    return matches(actual);
++      int (*matches)(const void*) = (int (*)(const void*)) constraint->expected;
++    return matches((const void *)actual);
+ }
+-static void test_with_matcher(Constraint *constraint, const char *function, const char* matcher_name, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) {
++static void test_with_matcher(Constraint *constraint, const char *function, intptr_t matcher_function, const char *test_file, int test_line, TestReporter *reporter) {
+     (*reporter->assert_true)(
+             reporter,
+             test_file,
+@@ -176,7 +175,7 @@ static void test_with_matcher(Constraint
+             (*constraint->compare)(constraint, matcher_function),
+             "Wanted parameter [%s] to match [%s] in function [%s]",
+             constraint->parameter,
+-            matcher_name,
++            constraint->name,
+             function);
+ }