mirror of https://github.com/oxen-io/lokinet
Update deps (#1348)
* Update submodules/static deps to latest versions * Add mingw zmq build patch * Drop support for Windows 2000pull/1355/head
parent
c64c9093f2
commit
f5e5066bd5
@ -0,0 +1,12 @@
|
|||||||
|
diff --git a/tests/testutil.hpp b/tests/testutil.hpp
|
||||||
|
index c6f5e4de..6a1c8bb8 100644
|
||||||
|
--- 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)
|
||||||
|
{
|
@ -1,69 +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
|
|
@ -1,43 +0,0 @@
|
|||||||
diff --git a/RELICENSE/tomzbench.md b/RELICENSE/tomzbench.md
|
|
||||||
new file mode 100644
|
|
||||||
index 000000000..1cbcc4fdb
|
|
||||||
--- /dev/null
|
|
||||||
+++ b/RELICENSE/tomzbench.md
|
|
||||||
@@ -0,0 +1,14 @@
|
|
||||||
+# Permission to Relicense under MPLv2
|
|
||||||
+
|
|
||||||
+This is a statement by Thomas Chiantia
|
|
||||||
+that grants permission to relicense its copyrights in the libzmq C++
|
|
||||||
+library (ZeroMQ) under the Mozilla Public License v2 (MPLv2).
|
|
||||||
+
|
|
||||||
+A portion of the commits made by the Github handle "tomzbench", with
|
|
||||||
+commit author "Thomas<Thomas@Altronix.com>", are copyright of
|
|
||||||
+Thomas Chiantia.
|
|
||||||
+This document hereby grants the libzmq project team to relicense libzmq,
|
|
||||||
+including all past, present and future contributions of the author listed above.
|
|
||||||
+
|
|
||||||
+Thomas Chiantia
|
|
||||||
+2019/08/10
|
|
||||||
diff --git a/src/thread.cpp b/src/thread.cpp
|
|
||||||
index 2cad2adaa..6f07e9cee 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;
|
|
||||||
- void *Handler;
|
|
||||||
-} 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,
|
|
@ -1,198 +0,0 @@
|
|||||||
From 00440f91ebbae83d7d2aeb429b306bee27f3b165 Mon Sep 17 00:00:00 2001
|
|
||||||
From: Rick V <rick@snowlight.net>
|
|
||||||
Date: Wed, 31 Oct 2019 17:20:05 -0500
|
|
||||||
Subject: ZMQ patches for Windows
|
|
||||||
|
|
||||||
Configure with: ./configure [--host=i686-w64-mingw32 --target=i686-w64-mingw32] --disable-shared
|
|
||||||
CFLAGS='-march=nocona -mfpmath=sse -O3' CPPFLAGS=-DZMQ_HAVE_WINDOWS_TARGET_XP
|
|
||||||
|
|
||||||
-rick
|
|
||||||
|
|
||||||
---
|
|
||||||
|
|
||||||
diff --git a/include/zmq.h b/include/zmq.h
|
|
||||||
index f5713f80..bb7b818e 100644
|
|
||||||
--- a/include/zmq.h
|
|
||||||
+++ b/include/zmq.h
|
|
||||||
@@ -65,14 +65,9 @@ extern "C" {
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef __MINGW32__
|
|
||||||
-// Require Windows XP or higher with MinGW for getaddrinfo().
|
|
||||||
-#if (_WIN32_WINNT >= 0x0501)
|
|
||||||
-#else
|
|
||||||
-#error You need at least Windows XP target
|
|
||||||
-#endif
|
|
||||||
-#endif
|
|
||||||
#include <winsock2.h>
|
|
||||||
#endif
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
/* Handle DSO symbol visibility */
|
|
||||||
#if defined _WIN32
|
|
||||||
diff --git a/src/address.hpp b/src/address.hpp
|
|
||||||
index b20a10e5..f848ec2b 100644
|
|
||||||
--- a/src/address.hpp
|
|
||||||
+++ b/src/address.hpp
|
|
||||||
@@ -38,6 +38,7 @@
|
|
||||||
#include <sys/socket.h>
|
|
||||||
#else
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
+#include <wspiapi.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
namespace zmq
|
|
||||||
diff --git a/src/ip_resolver.cpp b/src/ip_resolver.cpp
|
|
||||||
index 4a8283de..a8b6fe6c 100644
|
|
||||||
--- a/src/ip_resolver.cpp
|
|
||||||
+++ b/src/ip_resolver.cpp
|
|
||||||
@@ -595,6 +595,7 @@ int zmq::ip_resolver_t::wchar_to_utf8 (const WCHAR *src_, char **dest_) const
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
+#if !defined ZMQ_HAVE_WINDOWS_TARGET_XP
|
|
||||||
int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
|
|
||||||
{
|
|
||||||
int rc;
|
|
||||||
@@ -674,6 +675,17 @@ int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
|
|
||||||
}
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
+#else
|
|
||||||
+// On other platforms we assume there are no sane interface names.
|
|
||||||
+int zmq::ip_resolver_t::resolve_nic_name (ip_addr_t *ip_addr_, const char *nic_)
|
|
||||||
+{
|
|
||||||
+ LIBZMQ_UNUSED (ip_addr_);
|
|
||||||
+ LIBZMQ_UNUSED (nic_);
|
|
||||||
+
|
|
||||||
+ errno = ENODEV;
|
|
||||||
+ return -1;
|
|
||||||
+}
|
|
||||||
+#endif
|
|
||||||
|
|
||||||
#else
|
|
||||||
|
|
||||||
diff --git a/src/precompiled.hpp b/src/precompiled.hpp
|
|
||||||
index f22a6937..45e5ba10 100644
|
|
||||||
--- a/src/precompiled.hpp
|
|
||||||
+++ b/src/precompiled.hpp
|
|
||||||
@@ -85,6 +85,7 @@
|
|
||||||
#include <time.h>
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
+#include <wspiapi.h>
|
|
||||||
|
|
||||||
// standard C++ headers
|
|
||||||
#include <algorithm>
|
|
||||||
diff --git a/src/thread.cpp b/src/thread.cpp
|
|
||||||
index b14d7075..923d6a3d 100644
|
|
||||||
--- a/src/thread.cpp
|
|
||||||
+++ b/src/thread.cpp
|
|
||||||
@@ -61,10 +61,10 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_, const char *name_)
|
|
||||||
strncpy (_name, name_, sizeof (_name) - 1);
|
|
||||||
#if defined _WIN32_WCE
|
|
||||||
_descriptor =
|
|
||||||
- (HANDLE) CreateThread (NULL, 0, &::thread_routine, this, 0, NULL);
|
|
||||||
+ (HANDLE) CreateThread (NULL, 0, &::thread_routine, this, 0, &_threadID);
|
|
||||||
#else
|
|
||||||
_descriptor =
|
|
||||||
- (HANDLE) _beginthreadex (NULL, 0, &::thread_routine, this, 0, NULL);
|
|
||||||
+ (HANDLE) _beginthreadex (NULL, 0, &::thread_routine, this, 0, &_threadID);
|
|
||||||
#endif
|
|
||||||
win_assert (_descriptor != NULL);
|
|
||||||
_started = true;
|
|
||||||
@@ -72,7 +72,7 @@ void zmq::thread_t::start (thread_fn *tfn_, void *arg_, const char *name_)
|
|
||||||
|
|
||||||
bool zmq::thread_t::is_current_thread () const
|
|
||||||
{
|
|
||||||
- return GetCurrentThreadId () == GetThreadId (_descriptor);
|
|
||||||
+ return GetCurrentThreadId () == _threadID;
|
|
||||||
}
|
|
||||||
|
|
||||||
void zmq::thread_t::stop ()
|
|
||||||
@@ -124,7 +124,7 @@ void zmq::thread_t::
|
|
||||||
thread_info._name = _name;
|
|
||||||
thread_info._thread_id = -1;
|
|
||||||
thread_info._flags = 0;
|
|
||||||
-
|
|
||||||
+#ifdef _MSC_VER
|
|
||||||
#pragma warning(push)
|
|
||||||
#pragma warning(disable : 6320 6322)
|
|
||||||
__try {
|
|
||||||
@@ -136,6 +136,9 @@ void zmq::thread_t::
|
|
||||||
__except (EXCEPTION_CONTINUE_EXECUTION) {
|
|
||||||
}
|
|
||||||
#pragma warning(pop)
|
|
||||||
+#else
|
|
||||||
+(void)thread_info;
|
|
||||||
+#endif
|
|
||||||
}
|
|
||||||
|
|
||||||
#elif defined ZMQ_HAVE_VXWORKS
|
|
||||||
diff --git a/src/thread.hpp b/src/thread.hpp
|
|
||||||
index b13fc923..b4429af4 100644
|
|
||||||
--- a/src/thread.hpp
|
|
||||||
+++ b/src/thread.hpp
|
|
||||||
@@ -107,6 +107,7 @@ class thread_t
|
|
||||||
|
|
||||||
#ifdef ZMQ_HAVE_WINDOWS
|
|
||||||
HANDLE _descriptor;
|
|
||||||
+ unsigned _threadID;
|
|
||||||
#elif defined ZMQ_HAVE_VXWORKS
|
|
||||||
int _descriptor;
|
|
||||||
enum
|
|
||||||
diff --git a/src/udp_address.cpp b/src/udp_address.cpp
|
|
||||||
index d0dda564..1228e621 100644
|
|
||||||
--- a/src/udp_address.cpp
|
|
||||||
+++ b/src/udp_address.cpp
|
|
||||||
@@ -104,7 +104,11 @@ int zmq::udp_address_t::resolve (const char *name_, bool bind_, bool ipv6_)
|
|
||||||
if (src_name == "*") {
|
|
||||||
_bind_interface = 0;
|
|
||||||
} else {
|
|
||||||
+#ifndef _WIN32
|
|
||||||
_bind_interface = if_nametoindex (src_name.c_str ());
|
|
||||||
+#else
|
|
||||||
+ _bind_interface = 0;
|
|
||||||
+#endif
|
|
||||||
if (_bind_interface == 0) {
|
|
||||||
// Error, probably not an interface name.
|
|
||||||
_bind_interface = -1;
|
|
||||||
diff --git a/src/windows.hpp b/src/windows.hpp
|
|
||||||
index 2d3b4985..78c071a7 100644
|
|
||||||
--- a/src/windows.hpp
|
|
||||||
+++ b/src/windows.hpp
|
|
||||||
@@ -47,14 +47,6 @@
|
|
||||||
#define _WIN32_WINNT _WIN32_WINNT_WIN10
|
|
||||||
#endif
|
|
||||||
|
|
||||||
-#ifdef __MINGW32__
|
|
||||||
-// Require Windows XP or higher with MinGW for getaddrinfo().
|
|
||||||
-#if (_WIN32_WINNT >= 0x0501)
|
|
||||||
-#else
|
|
||||||
-#error You need at least Windows XP target
|
|
||||||
-#endif
|
|
||||||
-#endif
|
|
||||||
-
|
|
||||||
#include <winsock2.h>
|
|
||||||
#include <windows.h>
|
|
||||||
#include <mswsock.h>
|
|
||||||
@@ -78,6 +70,7 @@ struct tcp_keepalive
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#include <ws2tcpip.h>
|
|
||||||
+#include <wspiapi.h>
|
|
||||||
#include <ipexport.h>
|
|
||||||
#if !defined _WIN32_WCE
|
|
||||||
#include <process.h>
|
|
||||||
diff --git a/tests/testutil_monitoring.cpp b/tests/testutil_monitoring.cpp
|
|
||||||
index 75bd763c..7fb8dedb 100644
|
|
||||||
--- a/tests/testutil_monitoring.cpp
|
|
||||||
+++ b/tests/testutil_monitoring.cpp
|
|
||||||
@@ -26,6 +26,7 @@
|
|
||||||
You should have received a copy of the GNU Lesser General Public License
|
|
||||||
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
*/
|
|
||||||
+#define __USE_MINGW_ANSI_STDIO 1
|
|
||||||
#include "testutil_monitoring.hpp"
|
|
||||||
#include "testutil_unity.hpp"
|
|
||||||
|
|
@ -1 +1 @@
|
|||||||
Subproject commit 9a0ee2542848ab8625984fc8cdbfb9b5414c0082
|
Subproject commit cac99da8dc88be719a728dc1b597b0ac307c1800
|
@ -1 +1 @@
|
|||||||
Subproject commit e63a58c5bac94a3a75a7083f87bb092531407a92
|
Subproject commit d8abf146a43ea12d28b09dfa71ece3bad4168185
|
@ -1 +1 @@
|
|||||||
Subproject commit f52786b4badf82e1bfad06b52ade0397b61cd14e
|
Subproject commit 25f4b8b8a3c0f934158cd37a37b0525d75ca488e
|
@ -1 +1 @@
|
|||||||
Subproject commit 30faadf01a561be8bda1b9fd78cd606bb209576a
|
Subproject commit 0ac1d48bc8058bab4f10aeb3010343084f7a37d0
|
@ -1 +1 @@
|
|||||||
Subproject commit fe755dce12766820a99eefbde32d6ceb0a828ca8
|
Subproject commit 3b1dbebabc801c9cf6f0953a4c20b904d444f879
|
@ -1 +1 @@
|
|||||||
Subproject commit f7ef17a6bde6162e8b487deb36519bace412920a
|
Subproject commit b30ddc6a50dc582c93cd49d8d0cf8f5025ba1d2b
|
Loading…
Reference in New Issue