Skip to content

Commit 64047f8

Browse files
committed
depends: Add libevent compatibility patch for windows
Add a patch that seems to be necessary for compatibilty of libevent 2.0.22 with recent mingw-w64 gcc versions (at least GCC 5.3.1 from Ubuntu 16.04). Without this patch the Content-Length in the HTTP header ends up as `Content-Length: zu`, causing communication between the RPC client and server to break down. See discussion in #8653. Source: https://sourceforge.net/p/levent/bugs/363/ Thanks to @sstone for the suggestion.
1 parent 881d7ea commit 64047f8

File tree

2 files changed

+21
-2
lines changed

2 files changed

+21
-2
lines changed

depends/packages/libevent.mk

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,11 @@ $(package)_version=2.0.22
33
$(package)_download_path=https://github.com/libevent/libevent/releases/download/release-2.0.22-stable
44
$(package)_file_name=$(package)-$($(package)_version)-stable.tar.gz
55
$(package)_sha256_hash=71c2c49f0adadacfdbe6332a372c38cf9c8b7895bb73dabeaa53cdcc1d4e1fa3
6-
$(package)_patches=reuseaddr.patch
6+
$(package)_patches=reuseaddr.patch libevent-2-fixes.patch
77

88
define $(package)_preprocess_cmds
9-
patch -p1 < $($(package)_patch_dir)/reuseaddr.patch
9+
patch -p1 < $($(package)_patch_dir)/reuseaddr.patch && \
10+
patch -p1 < $($(package)_patch_dir)/libevent-2-fixes.patch
1011
endef
1112

1213
define $(package)_set_vars
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
--- a/util-internal.h 2013-11-01 12:18:57.000000000 -0600
2+
+++ b/util-internal.h 2015-07-20 20:19:43.199560900 -0500
3+
@@ -299,8 +299,13 @@ HANDLE evutil_load_windows_system_librar
4+
5+
#if defined(__STDC__) && defined(__STDC_VERSION__)
6+
#if (__STDC_VERSION__ >= 199901L)
7+
-#define EV_SIZE_FMT "%zu"
8+
-#define EV_SSIZE_FMT "%zd"
9+
+ #if defined(_MSC_VER) || defined(__MINGW32__) || defined(__MINGW64__)
10+
+ #define EV_SIZE_FMT "%Iu"
11+
+ #define EV_SSIZE_FMT "%Id"
12+
+ #else
13+
+ #define EV_SIZE_FMT "%zu"
14+
+ #define EV_SSIZE_FMT "%zd"
15+
+ #endif
16+
#define EV_SIZE_ARG(x) (x)
17+
#define EV_SSIZE_ARG(x) (x)
18+
#endif

0 commit comments

Comments
 (0)