File tree Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Expand file tree Collapse file tree 2 files changed +26
-1
lines changed Original file line number Diff line number Diff line change @@ -4,6 +4,7 @@ $(package)_download_path=https://github.com/libevent/libevent/releases/download/
44$(package)_file_name =$(package ) -$($(package ) _version) .tar.gz
55$(package)_sha256_hash =92e6de1be9ec176428fd2367677e61ceffc2ee1cb119035037a27d346b0403bb
66$(package)_patches =cmake_fixups.patch
7+ $(package)_patches += netbsd_fixup.patch
78$(package)_build_subdir =build
89
910# When building for Windows, we set _WIN32_WINNT to target the same Windows
@@ -23,7 +24,8 @@ define $(package)_set_vars
2324endef
2425
2526define $(package)_preprocess_cmds
26- patch -p1 < $($(package ) _patch_dir) /cmake_fixups.patch
27+ patch -p1 < $($(package ) _patch_dir) /cmake_fixups.patch && \
28+ patch -p1 < $($(package ) _patch_dir) /netbsd_fixup.patch
2729endef
2830
2931define $(package)_config_cmds
Original file line number Diff line number Diff line change 1+ Improve portability on NetBSD
2+
3+ According to GCC documentation, "the various `-std` options disable
4+ certain keywords".
5+ This change adheres to GCC's recommendation by replacing the `typeof`
6+ keyword with its alternative, `__typeof__`.
7+
8+ See https://github.com/libevent/libevent/commit/1759485e9a59147a47a674f5132fcfe764e7748c.
9+
10+
11+ --- a/kqueue.c
12+ +++ b/kqueue.c
13+ @@ -52,8 +52,8 @@
14+ * intptr_t, whereas others define it as void*. There doesn't seem to be an
15+ * easy way to tell them apart via autoconf, so we need to use OS macros. */
16+ #if defined(__NetBSD__)
17+ - #define PTR_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(x))
18+ - #define INT_TO_UDATA(x) ((typeof(((struct kevent *)0)->udata))(intptr_t)(x))
19+ + #define PTR_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(x))
20+ + #define INT_TO_UDATA(x) ((__typeof__(((struct kevent *)0)->udata))(intptr_t)(x))
21+ #elif defined(EVENT__HAVE_INTTYPES_H) && !defined(__OpenBSD__) && !defined(__FreeBSD__) && !defined(__darwin__) && !defined(__APPLE__) && !defined(__CloudABI__)
22+ #define PTR_TO_UDATA(x) ((intptr_t)(x))
23+ #define INT_TO_UDATA(x) ((intptr_t)(x))
You can’t perform that action at this time.
0 commit comments