summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--builds/msvc/libzmq/libzmq.vcproj8
-rw-r--r--src/tcp_address.cpp7
-rw-r--r--src/tcp_address.hpp8
3 files changed, 21 insertions, 2 deletions
diff --git a/builds/msvc/libzmq/libzmq.vcproj b/builds/msvc/libzmq/libzmq.vcproj
index 0a6bb49..401ebdb 100644
--- a/builds/msvc/libzmq/libzmq.vcproj
+++ b/builds/msvc/libzmq/libzmq.vcproj
@@ -423,6 +423,10 @@
>
</File>
<File
+ RelativePath="..\..\..\src\tcp_address.cpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\tcp_connecter.cpp"
>
</File>
@@ -705,6 +709,10 @@
>
</File>
<File
+ RelativePath="..\..\..\src\tcp_address.hpp"
+ >
+ </File>
+ <File
RelativePath="..\..\..\src\tcp_connecter.hpp"
>
</File>
diff --git a/src/tcp_address.cpp b/src/tcp_address.cpp
index 358c847..7be8b75 100644
--- a/src/tcp_address.cpp
+++ b/src/tcp_address.cpp
@@ -23,15 +23,14 @@
#include "tcp_address.hpp"
#include "platform.hpp"
+#include "stdint.hpp"
#include "err.hpp"
#ifdef ZMQ_HAVE_WINDOWS
#include "windows.hpp"
#else
#include <sys/types.h>
-#include <sys/socket.h>
#include <arpa/inet.h>
-#include <netinet/in.h>
#include <netinet/tcp.h>
#include <netdb.h>
#endif
@@ -415,7 +414,11 @@ socklen_t zmq::tcp_address_t::addrlen ()
return (socklen_t) sizeof (address.ipv4);
}
+#if defined ZMQ_HAVE_WINDOWS
+unsigned short zmq::tcp_address_t::family ()
+#else
sa_family_t zmq::tcp_address_t::family ()
+#endif
{
return address.generic.sa_family;
}
diff --git a/src/tcp_address.hpp b/src/tcp_address.hpp
index 7b848f9..a6075de 100644
--- a/src/tcp_address.hpp
+++ b/src/tcp_address.hpp
@@ -23,8 +23,12 @@
#include "platform.hpp"
+#if defined ZMQ_HAVE_WINDOWS
+#include "windows.hpp"
+#else
#include <sys/socket.h>
#include <netinet/in.h>
+#endif
namespace zmq
{
@@ -42,7 +46,11 @@ namespace zmq
// If 'ipv4only' is true, the name will never resolve to IPv6 address.
int resolve (const char* name_, bool local_, bool ipv4only_);
+#if defined ZMQ_HAVE_WINDOWS
+ unsigned short family ();
+#else
sa_family_t family ();
+#endif
sockaddr *addr ();
socklen_t addrlen ();