Skip to content

Commit cbbc229

Browse files
committed
depends: add zeromq windows usage patch
1 parent 2de68d6 commit cbbc229

File tree

2 files changed

+57
-1
lines changed

2 files changed

+57
-1
lines changed

depends/packages/zeromq.mk

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ $(package)_sha256_hash=6653ef5910f17954861fe72332e68b03ca6e4d9c7160eb3a8de5a5a91
66
$(package)_patches = remove_libstd_link.patch
77
$(package)_patches += macos_mktemp_check.patch
88
$(package)_patches += builtin_sha1.patch
9+
$(package)_patches += fix_have_windows.patch
910

1011
define $(package)_set_vars
1112
$(package)_config_opts = --without-docs --disable-shared --disable-valgrind
@@ -18,7 +19,8 @@ endef
1819
define $(package)_preprocess_cmds
1920
patch -p1 < $($(package)_patch_dir)/remove_libstd_link.patch && \
2021
patch -p1 < $($(package)_patch_dir)/macos_mktemp_check.patch && \
21-
patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch
22+
patch -p1 < $($(package)_patch_dir)/builtin_sha1.patch && \
23+
patch -p1 < $($(package)_patch_dir)/fix_have_windows.patch
2224
endef
2325

2426
define $(package)_config_cmds
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
This fixes several instances where _MSC_VER was
2+
used to determine whether to use afunix.h or not.
3+
4+
See https://github.com/zeromq/libzmq/pull/4678.
5+
--- a/src/ipc_address.hpp
6+
+++ b/src/ipc_address.hpp
7+
@@ -7,7 +7,7 @@
8+
9+
#include <string>
10+
11+
-#if defined _MSC_VER
12+
+#if defined ZMQ_HAVE_WINDOWS
13+
#include <afunix.h>
14+
#else
15+
#include <sys/socket.h>
16+
diff --git a/src/ipc_connecter.cpp b/src/ipc_connecter.cpp
17+
index 3f988745..ed2a0645 100644
18+
--- a/src/ipc_connecter.cpp
19+
+++ b/src/ipc_connecter.cpp
20+
@@ -16,7 +16,7 @@
21+
#include "ipc_address.hpp"
22+
#include "session_base.hpp"
23+
24+
-#ifdef _MSC_VER
25+
+#if defined ZMQ_HAVE_WINDOWS
26+
#include <afunix.h>
27+
#else
28+
#include <unistd.h>
29+
diff --git a/src/ipc_listener.cpp b/src/ipc_listener.cpp
30+
index 50126040..5428579b 100644
31+
--- a/src/ipc_listener.cpp
32+
+++ b/src/ipc_listener.cpp
33+
@@ -17,7 +17,7 @@
34+
#include "socket_base.hpp"
35+
#include "address.hpp"
36+
37+
-#ifdef _MSC_VER
38+
+#ifdef ZMQ_HAVE_WINDOWS
39+
#ifdef ZMQ_IOTHREAD_POLLER_USE_SELECT
40+
#error On Windows, IPC does not work with POLLER=select, use POLLER=epoll instead, or disable IPC transport
41+
#endif
42+
diff --git a/tests/testutil.cpp b/tests/testutil.cpp
43+
index bdc80283..6f21e8f6 100644
44+
--- a/tests/testutil.cpp
45+
+++ b/tests/testutil.cpp
46+
@@ -7,7 +7,7 @@
47+
48+
#if defined _WIN32
49+
#include "../src/windows.hpp"
50+
-#if defined _MSC_VER
51+
+#if defined ZMQ_HAVE_WINDOWS
52+
#if defined ZMQ_HAVE_IPC
53+
#include <direct.h>
54+
#include <afunix.h>

0 commit comments

Comments
 (0)