zeromq: update zeromq to 4.3.3 and cppzmq to 4.7.1

This commit is contained in:
Christoph Kahl
2020-10-13 19:30:21 +02:00
parent 8e2f00094e
commit 31ab0970d7
3 changed files with 60 additions and 185 deletions

View File

@@ -1,177 +0,0 @@
diff --git a/src/thread.cpp b/src/thread.cpp
index b14d70757..3675899be 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -32,6 +32,10 @@
#include "thread.hpp"
#include "err.hpp"
+#ifdef ZMQ_HAVE_WINDOWS
+#include <winnt.h>
+#endif
+
bool zmq::thread_t::get_started () const
{
return _started;
@@ -113,10 +117,22 @@ struct thread_info_t
#pragma pack(pop)
}
+typedef struct _MY_EXCEPTION_REGISTRATION_RECORD
+{
+ struct _MY_EXCEPTION_REGISTRATION_RECORD *Next;
+ void *Handler;
+} MY_EXCEPTION_REGISTRATION_RECORD;
+
+static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec,
+ void *frame, CONTEXT *ctx, void *disp)
+{
+ return ExceptionContinueExecution;
+}
+
void zmq::thread_t::
applyThreadName () // to be called in secondary thread context
{
- if (!_name[0])
+ if (!_name[0] || !IsDebuggerPresent())
return;
thread_info_t thread_info;
@@ -125,17 +141,19 @@ void zmq::thread_t::
thread_info._thread_id = -1;
thread_info._flags = 0;
-#pragma warning(push)
-#pragma warning(disable : 6320 6322)
- __try {
- DWORD MS_VC_EXCEPTION = 0x406D1388;
+ NT_TIB *tib = ((NT_TIB*)NtCurrentTeb());
+
+ MY_EXCEPTION_REGISTRATION_RECORD rec;
+ rec.Next = (MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList;
+ rec.Handler = continue_execution;
+
+ // push our handler, raise, and finally pop our handler
+ tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)&rec;
+ DWORD MS_VC_EXCEPTION = 0x406D1388;
RaiseException (MS_VC_EXCEPTION, 0,
- sizeof (thread_info) / sizeof (ULONG_PTR),
- (ULONG_PTR *) &thread_info);
- }
- __except (EXCEPTION_CONTINUE_EXECUTION) {
- }
-#pragma warning(pop)
+ sizeof (thread_info) / sizeof (ULONG_PTR),
+ (ULONG_PTR *) &thread_info);
+ tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)(((MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList)->Next);
}
#elif defined ZMQ_HAVE_VXWORKS
diff --git a/src/thread.cpp b/src/thread.cpp
index 3675899be..2cad2adaa 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -124,15 +124,17 @@ typedef struct _MY_EXCEPTION_REGISTRATION_RECORD
} MY_EXCEPTION_REGISTRATION_RECORD;
static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec,
- void *frame, CONTEXT *ctx, void *disp)
+ void *frame,
+ CONTEXT *ctx,
+ void *disp)
{
- return ExceptionContinueExecution;
+ return ExceptionContinueExecution;
}
void zmq::thread_t::
applyThreadName () // to be called in secondary thread context
{
- if (!_name[0] || !IsDebuggerPresent())
+ if (!_name[0] || !IsDebuggerPresent ())
return;
thread_info_t thread_info;
@@ -141,19 +143,21 @@ void zmq::thread_t::
thread_info._thread_id = -1;
thread_info._flags = 0;
- NT_TIB *tib = ((NT_TIB*)NtCurrentTeb());
+ NT_TIB *tib = ((NT_TIB *) NtCurrentTeb ());
MY_EXCEPTION_REGISTRATION_RECORD rec;
- rec.Next = (MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList;
+ rec.Next = (MY_EXCEPTION_REGISTRATION_RECORD *) tib->ExceptionList;
rec.Handler = continue_execution;
// push our handler, raise, and finally pop our handler
- tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)&rec;
+ tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *) &rec;
DWORD MS_VC_EXCEPTION = 0x406D1388;
- RaiseException (MS_VC_EXCEPTION, 0,
- sizeof (thread_info) / sizeof (ULONG_PTR),
- (ULONG_PTR *) &thread_info);
- tib->ExceptionList = (_EXCEPTION_REGISTRATION_RECORD *)(((MY_EXCEPTION_REGISTRATION_RECORD *)tib->ExceptionList)->Next);
+ RaiseException (MS_VC_EXCEPTION, 0,
+ sizeof (thread_info) / sizeof (ULONG_PTR),
+ (ULONG_PTR *) &thread_info);
+ tib->ExceptionList =
+ (_EXCEPTION_REGISTRATION_RECORD
+ *) (((MY_EXCEPTION_REGISTRATION_RECORD *) tib->ExceptionList)->Next);
}
#elif defined ZMQ_HAVE_VXWORKS
diff --git a/src/thread.cpp b/src/thread.cpp
index 2cad2ada..4cc5944e 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -120,7 +120,7 @@ struct thread_info_t
typedef struct _MY_EXCEPTION_REGISTRATION_RECORD
{
struct _MY_EXCEPTION_REGISTRATION_RECORD *Next;
- void *Handler;
+ EXCEPTION_DISPOSITION (*Handler) (EXCEPTION_RECORD*, void*, CONTEXT*, void*);
} MY_EXCEPTION_REGISTRATION_RECORD;
static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec,
diff --git a/src/thread.cpp b/src/thread.cpp
index 4cc5944e..b81d458a 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -120,7 +120,7 @@ struct thread_info_t
typedef struct _MY_EXCEPTION_REGISTRATION_RECORD
{
struct _MY_EXCEPTION_REGISTRATION_RECORD *Next;
- EXCEPTION_DISPOSITION (*Handler) (EXCEPTION_RECORD*, void*, CONTEXT*, void*);
+ EXCEPTION_DISPOSITION NTAPI (*Handler) (EXCEPTION_RECORD*, void*, CONTEXT*, void*);
} MY_EXCEPTION_REGISTRATION_RECORD;
static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec,
diff --git a/src/thread.cpp b/src/thread.cpp
index b81d458a..6f07e9ce 100644
--- a/src/thread.cpp
+++ b/src/thread.cpp
@@ -117,11 +117,14 @@ struct thread_info_t
#pragma pack(pop)
}
-typedef struct _MY_EXCEPTION_REGISTRATION_RECORD
+struct MY_EXCEPTION_REGISTRATION_RECORD
{
- struct _MY_EXCEPTION_REGISTRATION_RECORD *Next;
- EXCEPTION_DISPOSITION NTAPI (*Handler) (EXCEPTION_RECORD*, void*, CONTEXT*, void*);
-} MY_EXCEPTION_REGISTRATION_RECORD;
+ typedef EXCEPTION_DISPOSITION (NTAPI *HandlerFunctionType) (
+ EXCEPTION_RECORD *, void *, CONTEXT *, void *);
+
+ MY_EXCEPTION_REGISTRATION_RECORD *Next;
+ HandlerFunctionType Handler;
+};
static EXCEPTION_DISPOSITION NTAPI continue_execution (EXCEPTION_RECORD *rec,
void *frame,

View File

@@ -0,0 +1,52 @@
--- a/tests/testutil.cpp
+++ b/tests/testutil.cpp
@@ -382,7 +382,7 @@ fd_t connect_socket (const char *endpoint_, const int af_, const int protocol_)
protocol_ == IPPROTO_UDP
? IPPROTO_UDP
: protocol_ == IPPROTO_TCP ? IPPROTO_TCP : 0);
- TEST_ASSERT_NOT_EQUAL (-1, s_pre);
+ TEST_ASSERT_NOT_EQUAL (retired_fd, s_pre);
if (af_ == AF_INET || af_ == AF_INET6) {
const char *port = strrchr (endpoint_, ':') + 1;
@@ -439,7 +439,7 @@ fd_t bind_socket_resolve_port (const char *address_,
protocol_ == IPPROTO_UDP
? IPPROTO_UDP
: protocol_ == IPPROTO_TCP ? IPPROTO_TCP : 0);
- TEST_ASSERT_NOT_EQUAL (-1, s_pre);
+ TEST_ASSERT_NOT_EQUAL (retired_fd, s_pre);
if (af_ == AF_INET || af_ == AF_INET6) {
#ifdef ZMQ_HAVE_WINDOWS
--- a/tests/testutil.hpp
+++ b/tests/testutil.hpp
@@ -102,7 +102,6 @@ const uint8_t zmtp_ready_sub[27] = {
#include <winsock2.h>
#include <ws2tcpip.h>
#include <stdexcept>
-#define close closesocket
typedef int socket_size_t;
inline const char *as_setsockopt_opt_t (const void *opt)
{
--- a/tests/testutil.cpp
+++ b/tests/testutil.cpp
@@ -296,7 +296,7 @@ int is_ipv6_available ()
ipv6 = 0;
}
#endif
- close (fd);
+ closesocket (fd);
}
return ipv6;
@@ -484,7 +484,7 @@ fd_t bind_socket_resolve_port (const char *address_,
#else
int fd = mkstemp (buffer);
TEST_ASSERT_TRUE (fd != -1);
- close (fd);
+ closesocket (fd);
#endif
#endif
strcpy ((*(struct sockaddr_un *) &addr).sun_path, buffer);

View File

@@ -3,8 +3,8 @@
_realname=zeromq
pkgbase=mingw-w64-${_realname}
pkgname="${MINGW_PACKAGE_PREFIX}-${_realname}"
pkgver=4.3.2
_cppzmqver=4.5.0
pkgver=4.3.3
_cppzmqver=4.7.1
pkgrel=1
pkgdesc="Fast messaging system built on sockets, C and C++ bindings. aka 0MQ, ZMQ (mingw-w64)"
arch=('any')
@@ -16,15 +16,15 @@ options=('staticlibs' 'strip')
source=("https://github.com/zeromq/libzmq/releases/download/v${pkgver}/${_realname}-${pkgver}.tar.gz"
"zmq-${_cppzmqver}.hpp::https://raw.githubusercontent.com/zeromq/cppzmq/v${_cppzmqver}/zmq.hpp"
"zmq_addon-${_cppzmqver}.hpp::https://raw.githubusercontent.com/zeromq/cppzmq/v${_cppzmqver}/zmq_addon.hpp"
"001-mingw-__except-fixes.patch")
sha256sums=('ebd7b5c830d6428956b67a0454a7f8cbed1de74b3b01e5c33c5378e22740f763'
'132c0e40e5a2f97e6946d2a3d0428e05c916c6d2c5702a59188f9788e09d2321'
'cb0e966111b73689c9fb908bef46ddaf327cba299c41f24d67f1a0151e11242d'
'054314f319d9b7d085975e01ddb7bcf39377ceef38b9796cd40d40cde6ce78ca')
"001-testutil_different_signedness-fix.patch")
sha256sums=('9d9285db37ae942ed0780c016da87060497877af45094ff9e1a1ca736e3875a2'
'92b92acc0a93f9511097df20cc9ed4041bde4d0d9c6cdd6cc2ada29c84487ab8'
'705bac35610437f22243da8cf300488d1e37c0815c60f70809051a8be8d0cb4c'
'af238d54dd615654fda61e42bb6393da529cb288a74310f2c82d5d27933c1011')
prepare() {
cd ${_realname}-${pkgver}
patch -Np1 -i "${srcdir}/001-mingw-__except-fixes.patch"
patch -Np1 -i "${srcdir}/001-testutil_different_signedness-fix.patch"
}
build() {