From 0c022bb26e6307bc0aea8f95bddae1fdb25abbd3 Mon Sep 17 00:00:00 2001 From: yuncang123 <1050706328@qq.com> Date: Mon, 9 Sep 2024 21:43:27 +0800 Subject: [PATCH] sync pr,support clang build --- 0004-fix-function-undeclared.patch | 25 +++++++++++++++++++++++++ add-testcases-for-event.c-apis.patch | 10 +++++----- libevent.spec | 9 +++++++-- 3 files changed, 37 insertions(+), 7 deletions(-) create mode 100644 0004-fix-function-undeclared.patch diff --git a/0004-fix-function-undeclared.patch b/0004-fix-function-undeclared.patch new file mode 100644 index 0000000..276ae80 --- /dev/null +++ b/0004-fix-function-undeclared.patch @@ -0,0 +1,25 @@ +From 319c98ee6462ecc890e6a7163b0d02690235caae Mon Sep 17 00:00:00 2001 +From: yuncang123 <1050706328@qq.com> +Date: Fri, 30 Aug 2024 22:52:18 +0800 +Subject: [PATCH] fix function undeclared + +--- + test/regress.c | 2 ++ + 1 file changed, 2 insertions(+) + +diff --git a/test/regress.c b/test/regress.c +index 08c30fa..bd42f4a 100644 +--- a/test/regress.c ++++ b/test/regress.c +@@ -75,6 +75,8 @@ + #include "regress.gen.h" + #endif + ++#include "iocp-internal.h" ++ + evutil_socket_t pair[2]; + int test_ok; + int called; +-- +2.43.0 + diff --git a/add-testcases-for-event.c-apis.patch b/add-testcases-for-event.c-apis.patch index c5b16fd..d03edf7 100644 --- a/add-testcases-for-event.c-apis.patch +++ b/add-testcases-for-event.c-apis.patch @@ -214,8 +214,8 @@ index 08c30fa..0704b46 100644 + int n_cpus = 4; + + cfg = event_config_new(); -+ event_config_set_num_cpus_hint(cfg, 4); -+ tt_assert(4 == cfg->n_cpus_hint); ++ event_config_set_num_cpus_hint(cfg, n_cpus); ++ tt_assert(n_cpus == cfg->n_cpus_hint); +end: + if (cfg) + event_config_free(cfg); @@ -227,7 +227,7 @@ index 08c30fa..0704b46 100644 + struct basic_test_data *data = arg; + struct event_base *base = data->base; +#ifndef _WIN32 -+ int res = event_base_start_iocp_(base); ++ int res = event_base_start_iocp_(base,0); + tt_int_op(res, ==, -1); + event_base_stop_iocp_(base); +#endif @@ -243,8 +243,8 @@ index 08c30fa..0704b46 100644 + BASIC(event_del_noblock, TT_FORK|TT_NEED_BASE), + BASIC(event_del_block, TT_FORK|TT_NEED_BASE), + BASIC(event_get_events, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR), -+ BASIC(event_config_set_max_dispatch_interval, TT_FORK|TT_NEED_BASE), -+ BASIC(event_config_set_num_cpus_hint, TT_FORK|TT_NEED_BASE), ++ LEGACY(event_config_set_max_dispatch_interval, TT_FORK|TT_NEED_BASE), ++ LEGACY(event_config_set_num_cpus_hint, TT_FORK|TT_NEED_BASE), + BASIC(event_base_stop_iocp_, TT_FORK|TT_NEED_BASE), + /* Some converted-over tests */ diff --git a/libevent.spec b/libevent.spec index 9e02547..b48b062 100644 --- a/libevent.spec +++ b/libevent.spec @@ -1,13 +1,13 @@ Name: libevent Version: 2.1.12 -Release: 13 +Release: 14 Summary: An event notification library License: BSD URL: http://libevent.org/ Source0: https://github.com/libevent/libevent/releases/download/release-%{version}-stable/libevent-%{version}-stable.tar.gz -BuildRequires: gcc doxygen openssl-devel +BuildRequires: gcc doxygen openssl-devel autoconf automake libtool Patch0: libevent-nonettests.patch Patch1: http-add-callback-to-allow-server-to-decline-and-the.patch @@ -30,6 +30,8 @@ Patch6007: backport-Fix-potential-Null-pointer-dereference-in-regress_thread.c.p Patch6008: backport-Fix-potential-Null-pointer-dereference-in-regress_buffer.c.patch Patch6009: backport-Fix-potential-Null-pointer-dereference-in-regress_et.c.patch +Patch0004: 0004-fix-function-undeclared.patch + %description Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets, filters, rate-limiting, SSL, zero-copy file transmission, and IOCP. @@ -89,6 +91,9 @@ rm -f %{buildroot}%{_libdir}/*.la %changelog +* Fri Aug 30 2024 yuanchao <1050706328@qq.com> - 2.1.12-14 +- Fix function undeclared,incompatible pointer and parameter lack in 'add-testcases-for-event.c-apis.patch',support clang build + * Thu Aug 15 2024 zhangxingrong - 2.1.12-13 - Fix potential Null pointer dereference in regress_thread.c - Fix potential Null pointer dereference in regress_buffer.c -- Gitee