Merge pull request #100 from CommanderBubble/master

compilation fixes for when _WIN32_WINNT >= 0x0600
This commit is contained in:
Pieter Hintjens 2016-02-12 13:45:12 +01:00
commit b341dd7ffe
7 changed files with 30 additions and 8 deletions

View File

@ -28,7 +28,6 @@
*/ */
#include "err.hpp" #include "err.hpp"
#include "platform.hpp"
const char *zmq::errno_to_string (int errno_) const char *zmq::errno_to_string (int errno_)
{ {

View File

@ -41,10 +41,6 @@
#include <stdio.h> #include <stdio.h>
#include "platform.hpp" #include "platform.hpp"
#include "likely.hpp"
// 0MQ-specific error codes are defined in zmq.h
#include "../include/zmq.h"
#ifdef ZMQ_HAVE_WINDOWS #ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp" #include "windows.hpp"
@ -52,6 +48,11 @@
#include <netdb.h> #include <netdb.h>
#endif #endif
#include "likely.hpp"
// 0MQ-specific error codes are defined in zmq.h
#include "../include/zmq.h"
// EPROTO is not used by OpenBSD and maybe other platforms. // EPROTO is not used by OpenBSD and maybe other platforms.
#ifndef EPROTO #ifndef EPROTO
#define EPROTO 0 #define EPROTO 0

View File

@ -27,6 +27,12 @@
along with this program. If not, see <http://www.gnu.org/licenses/>. along with this program. If not, see <http://www.gnu.org/licenses/>.
*/ */
#include "platform.hpp"
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#include "msg.hpp" #include "msg.hpp"
#include "../include/zmq.h" #include "../include/zmq.h"

View File

@ -32,6 +32,10 @@
#include "platform.hpp" #include "platform.hpp"
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#endif
#if defined ZMQ_USE_KQUEUE + defined ZMQ_USE_EPOLL \ #if defined ZMQ_USE_KQUEUE + defined ZMQ_USE_EPOLL \
+ defined ZMQ_USE_DEVPOLL + defined ZMQ_USE_POLL \ + defined ZMQ_USE_DEVPOLL + defined ZMQ_USE_POLL \
+ defined ZMQ_USE_SELECT > 1 + defined ZMQ_USE_SELECT > 1

View File

@ -245,7 +245,11 @@ int main (void)
ip4addr.sin_family = AF_INET; ip4addr.sin_family = AF_INET;
ip4addr.sin_port = htons (9998); ip4addr.sin_port = htons (9998);
inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #if (ZMQ_HAVE_WINDOWS and _WIN32_WINNT < 0x0600)
ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1");
#else
inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr);
#endif
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
rc = connect (s, (struct sockaddr*) &ip4addr, sizeof (ip4addr)); rc = connect (s, (struct sockaddr*) &ip4addr, sizeof (ip4addr));

View File

@ -158,7 +158,11 @@ int main (void)
ip4addr.sin_family = AF_INET; ip4addr.sin_family = AF_INET;
ip4addr.sin_port = htons(9003); ip4addr.sin_port = htons(9003);
inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr); #if (ZMQ_HAVE_WINDOWS and _WIN32_WINNT < 0x0600)
ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1");
#else
inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr);
#endif
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
rc = connect (s, (struct sockaddr*) &ip4addr, sizeof ip4addr); rc = connect (s, (struct sockaddr*) &ip4addr, sizeof ip4addr);

View File

@ -164,7 +164,11 @@ int main (void)
ip4addr.sin_family = AF_INET; ip4addr.sin_family = AF_INET;
ip4addr.sin_port = htons (9998); ip4addr.sin_port = htons (9998);
inet_pton (AF_INET, "127.0.0.1", &ip4addr.sin_addr); #if (ZMQ_HAVE_WINDOWS and _WIN32_WINNT < 0x0600)
ip4addr.sin_addr.s_addr = inet_addr ("127.0.0.1");
#else
inet_pton(AF_INET, "127.0.0.1", &ip4addr.sin_addr);
#endif
s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP); s = socket (AF_INET, SOCK_STREAM, IPPROTO_TCP);
rc = connect (s, (struct sockaddr*) &ip4addr, sizeof (ip4addr)); rc = connect (s, (struct sockaddr*) &ip4addr, sizeof (ip4addr));