mirror of
https://github.com/zeromq/libzmq.git
synced 2024-12-27 07:31:03 +08:00
Fix compilation with mingw64 using autotools
This commit is contained in:
parent
7b063a067c
commit
9835e18f64
@ -58,6 +58,20 @@ extern "C" {
|
||||
#include <stddef.h>
|
||||
#include <stdio.h>
|
||||
#if defined _WIN32
|
||||
// Set target version to Windows Server 2008, Windows Vista or higher.
|
||||
// Windows XP (0x0501) is supported but without client & server socket types.
|
||||
#ifndef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
|
||||
#ifdef __MINGW32__
|
||||
// Require Windows XP or higher with MinGW for getaddrinfo().
|
||||
#if(_WIN32_WINNT >= 0x0600)
|
||||
#else
|
||||
#undef _WIN32_WINNT
|
||||
#define _WIN32_WINNT 0x0600
|
||||
#endif
|
||||
#endif
|
||||
#include <winsock2.h>
|
||||
#endif
|
||||
|
||||
|
@ -30,6 +30,10 @@
|
||||
#ifndef __ZMQ_FD_HPP_INCLUDED__
|
||||
#define __ZMQ_FD_HPP_INCLUDED__
|
||||
|
||||
#if defined _WIN32
|
||||
#include <windows.hpp>
|
||||
#endif
|
||||
|
||||
namespace zmq
|
||||
{
|
||||
#ifdef ZMQ_HAVE_WINDOWS
|
||||
|
@ -35,7 +35,7 @@
|
||||
|
||||
zmq::reaper_t::reaper_t (class ctx_t *ctx_, uint32_t tid_) :
|
||||
object_t (ctx_, tid_),
|
||||
mailbox_handle(NULL),
|
||||
mailbox_handle((poller_t::handle_t)NULL),
|
||||
sockets (0),
|
||||
terminating (false)
|
||||
{
|
||||
|
@ -277,7 +277,7 @@ void zmq::select_t::loop ()
|
||||
if (family_entries.size () > 1) {
|
||||
rc = WSAWaitForMultipleEvents (4, wsa_events.events, FALSE,
|
||||
timeout ? timeout : INFINITE, FALSE);
|
||||
wsa_assert (rc != WSA_WAIT_FAILED);
|
||||
wsa_assert (rc != (int)WSA_WAIT_FAILED);
|
||||
zmq_assert (rc != WSA_WAIT_IO_COMPLETION);
|
||||
|
||||
if (rc == WSA_WAIT_TIMEOUT)
|
||||
|
@ -194,7 +194,7 @@ zmq::socket_base_t::socket_base_t (ctx_t *parent_, uint32_t tid_, int sid_, bool
|
||||
ctx_terminated (false),
|
||||
destroyed (false),
|
||||
poller(NULL),
|
||||
handle(NULL),
|
||||
handle((poller_t::handle_t)NULL),
|
||||
last_tsc (0),
|
||||
ticks (0),
|
||||
rcvmore (false),
|
||||
|
@ -58,7 +58,7 @@ zmq::socks_connecter_t::socks_connecter_t (class io_thread_t *io_thread_,
|
||||
proxy_addr (proxy_addr_),
|
||||
status (unplugged),
|
||||
s (retired_fd),
|
||||
handle(NULL),
|
||||
handle((handle_t)NULL),
|
||||
handle_valid(false),
|
||||
delayed_start (delayed_start_),
|
||||
timer_started(false),
|
||||
|
@ -61,7 +61,7 @@ zmq::stream_engine_t::stream_engine_t (fd_t fd_, const options_t &options_,
|
||||
const std::string &endpoint_) :
|
||||
s (fd_),
|
||||
as_server(false),
|
||||
handle(NULL),
|
||||
handle((handle_t)NULL),
|
||||
inpos (NULL),
|
||||
insize (0),
|
||||
decoder (NULL),
|
||||
|
@ -64,7 +64,7 @@ zmq::tcp_connecter_t::tcp_connecter_t (class io_thread_t *io_thread_,
|
||||
io_object_t (io_thread_),
|
||||
addr (addr_),
|
||||
s (retired_fd),
|
||||
handle(NULL),
|
||||
handle((handle_t)NULL),
|
||||
handle_valid (false),
|
||||
delayed_start (delayed_start_),
|
||||
connect_timer_started (false),
|
||||
|
@ -62,7 +62,7 @@ zmq::tcp_listener_t::tcp_listener_t (io_thread_t *io_thread_,
|
||||
own_t (io_thread_, options_),
|
||||
io_object_t (io_thread_),
|
||||
s (retired_fd),
|
||||
handle(NULL),
|
||||
handle((handle_t)NULL),
|
||||
socket (socket_)
|
||||
{
|
||||
}
|
||||
|
@ -47,7 +47,7 @@ zmq::udp_engine_t::udp_engine_t(const options_t &options_) :
|
||||
plugged (false),
|
||||
fd(-1),
|
||||
session(NULL),
|
||||
handle(NULL),
|
||||
handle((handle_t)NULL),
|
||||
address(NULL),
|
||||
options(options_),
|
||||
send_enabled(false),
|
||||
|
Loading…
x
Reference in New Issue
Block a user