!74 Fix function undeclared,incompatible pointer and parameter lack in 'add-testcases-for-event.c-apis.patch',support clang build

From: @yuncang123 
Reviewed-by: @dillon_chen 
Signed-off-by: @dillon_chen
This commit is contained in:
openeuler-ci-bot 2024-09-05 09:56:15 +00:00 committed by Gitee
commit 2e3fb3cf30
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F
3 changed files with 37 additions and 7 deletions

View File

@ -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

View File

@ -214,8 +214,8 @@ index 08c30fa..0704b46 100644
+ int n_cpus = 4; + int n_cpus = 4;
+ +
+ cfg = event_config_new(); + cfg = event_config_new();
+ event_config_set_num_cpus_hint(cfg, 4); + event_config_set_num_cpus_hint(cfg, n_cpus);
+ tt_assert(4 == cfg->n_cpus_hint); + tt_assert(n_cpus == cfg->n_cpus_hint);
+end: +end:
+ if (cfg) + if (cfg)
+ event_config_free(cfg); + event_config_free(cfg);
@ -227,7 +227,7 @@ index 08c30fa..0704b46 100644
+ struct basic_test_data *data = arg; + struct basic_test_data *data = arg;
+ struct event_base *base = data->base; + struct event_base *base = data->base;
+#ifndef _WIN32 +#ifndef _WIN32
+ int res = event_base_start_iocp_(base); + int res = event_base_start_iocp_(base,0);
+ tt_int_op(res, ==, -1); + tt_int_op(res, ==, -1);
+ event_base_stop_iocp_(base); + event_base_stop_iocp_(base);
+#endif +#endif
@ -243,8 +243,8 @@ index 08c30fa..0704b46 100644
+ BASIC(event_del_noblock, TT_FORK|TT_NEED_BASE), + BASIC(event_del_noblock, TT_FORK|TT_NEED_BASE),
+ BASIC(event_del_block, 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_get_events, TT_FORK|TT_NEED_BASE|TT_NEED_SOCKETPAIR),
+ BASIC(event_config_set_max_dispatch_interval, TT_FORK|TT_NEED_BASE), + LEGACY(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_num_cpus_hint, TT_FORK|TT_NEED_BASE),
+ BASIC(event_base_stop_iocp_, TT_FORK|TT_NEED_BASE), + BASIC(event_base_stop_iocp_, TT_FORK|TT_NEED_BASE),
+ +
/* Some converted-over tests */ /* Some converted-over tests */

View File

@ -1,13 +1,13 @@
Name: libevent Name: libevent
Version: 2.1.12 Version: 2.1.12
Release: 12 Release: 13
Summary: An event notification library Summary: An event notification library
License: BSD License: BSD
URL: http://libevent.org/ URL: http://libevent.org/
Source0: https://github.com/libevent/libevent/releases/download/release-%{version}-stable/libevent-%{version}-stable.tar.gz 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 Patch0: libevent-nonettests.patch
Patch1: http-add-callback-to-allow-server-to-decline-and-the.patch Patch1: http-add-callback-to-allow-server-to-decline-and-the.patch
@ -26,6 +26,8 @@ Patch6004: backport-evutil-don-t-call-memset-before-memcpy.patch
Patch6005: 0002-Avoid-calling-read-2-on-eventfd-on-each-event-loop-w.patch Patch6005: 0002-Avoid-calling-read-2-on-eventfd-on-each-event-loop-w.patch
Patch6006: backport-Makefile-missing-test-dir.patch Patch6006: backport-Makefile-missing-test-dir.patch
Patch0004: 0004-fix-function-undeclared.patch
%description %description
Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets, Libevent additionally provides a sophisticated framework for buffered network IO, with support for sockets,
filters, rate-limiting, SSL, zero-copy file transmission, and IOCP. filters, rate-limiting, SSL, zero-copy file transmission, and IOCP.
@ -86,6 +88,9 @@ rm -f %{buildroot}%{_libdir}/*.la
%changelog %changelog
* Fri Aug 30 2024 yuanchao <1050706328@qq.com> - 2.1.12-13
- Fix function undeclared,incompatible pointer and parameter lack in 'add-testcases-for-event.c-apis.patch',support clang build
* Tue Aug 13 2024 wangjiang <wangjiang37@h-partners.com> - 2.1.12-12 * Tue Aug 13 2024 wangjiang <wangjiang37@h-partners.com> - 2.1.12-12
- Fix missing test directory creation - Fix missing test directory creation