summaryrefslogtreecommitdiff
path: root/cpp/src/Ice/Network.cpp
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2014-08-15 12:51:51 -0400
committerBernard Normier <bernard@zeroc.com>2014-08-15 12:51:51 -0400
commit5e7e330aa21c5555b554231d6e3021ca43953ffd (patch)
tree31e8573386a8eb77cfdd8be2ea8b259c8dc37707 /cpp/src/Ice/Network.cpp
parentICE-5632 - Add missing operations tests for C++, Python, Java and C# (diff)
downloadice-5e7e330aa21c5555b554231d6e3021ca43953ffd.tar.bz2
ice-5e7e330aa21c5555b554231d6e3021ca43953ffd.tar.xz
ice-5e7e330aa21c5555b554231d6e3021ca43953ffd.zip
Added SIO_LOOPBACK_FAST_PATH definition for MinGW build
Diffstat (limited to 'cpp/src/Ice/Network.cpp')
-rw-r--r--cpp/src/Ice/Network.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 10ed510453a..06e664c8a95 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -38,6 +38,7 @@
# endif
# include <iphlpapi.h>
# include <Mswsock.h>
+# include <mstcpip.h>
#else
# include <net/if.h>
# include <sys/ioctl.h>
@@ -50,9 +51,15 @@
#endif
#if defined(__MINGW32__)
+//
+// Work-around for missing definitions in MinGW Windows headers
+//
# ifndef IPV6_V6ONLY
# define IPV6_V6ONLY 27
# endif
+# ifndef SIO_LOOPBACK_FAST_PATH
+# define SIO_LOOPBACK_FAST_PATH _WSAIOW(IOC_VENDOR,16)
+# endif
extern "C"
{
@@ -60,9 +67,6 @@ extern "C"
}
#endif
-#if defined(_WIN32) && !defined(ICE_OS_WINRT)
-# include <mstcpip.h>
-#endif
using namespace std;
using namespace Ice;
@@ -154,6 +158,7 @@ setTcpLoopbackFastPath(SOCKET fd)
{
int OptionValue = 1;
DWORD NumberOfBytesReturned = 0;
+
int status =
WSAIoctl(fd, SIO_LOOPBACK_FAST_PATH, &OptionValue, sizeof(OptionValue), NULL, 0, &NumberOfBytesReturned, 0, 0);
if(status == SOCKET_ERROR)