summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2014-07-24 18:50:20 -0400
committerBernard Normier <bernard@zeroc.com>2014-07-24 18:50:20 -0400
commit2afc67db3fa6f87538bb927b9621a351948883a4 (patch)
tree4324c78515e48615e082658d80fef0a0638f162c /cpp/src
parentCompleted fix for ICE-5567: move various C++11 classes/functions out of line (diff)
downloadice-2afc67db3fa6f87538bb927b9621a351948883a4.tar.bz2
ice-2afc67db3fa6f87538bb927b9621a351948883a4.tar.xz
ice-2afc67db3fa6f87538bb927b9621a351948883a4.zip
Build fixes for MinGW 4.7.2-32
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Ice/Network.cpp16
-rw-r--r--cpp/src/IceUtil/OutputUtil.cpp7
-rw-r--r--cpp/src/IceUtil/Random.cpp4
-rw-r--r--cpp/src/IceUtil/StringConverter.cpp13
4 files changed, 29 insertions, 11 deletions
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index f8f3b2e96b8..880c66e8ce3 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -22,10 +22,7 @@
// some definitions.
//
#if defined(__MINGW32__)
-# define _WIN32_WINNT 0x0501
-# ifndef IPV6_V6ONLY
-# define IPV6_V6ONLY 27
-# endif
+#define _WIN32_WINNT 0x0600
#endif
#include <IceUtil/DisableWarnings.h>
@@ -57,6 +54,17 @@
# include <sys/sockio.h>
#endif
+#if defined(__MINGW32__)
+# ifndef IPV6_V6ONLY
+# define IPV6_V6ONLY 27
+# endif
+
+extern "C"
+{
+ WINSOCK_API_LINKAGE int WSAAPI inet_pton(INT, PCTSTR, PVOID);
+}
+#endif
+
using namespace std;
using namespace Ice;
using namespace IceInternal;
diff --git a/cpp/src/IceUtil/OutputUtil.cpp b/cpp/src/IceUtil/OutputUtil.cpp
index e1fe349cf61..9475a80c143 100644
--- a/cpp/src/IceUtil/OutputUtil.cpp
+++ b/cpp/src/IceUtil/OutputUtil.cpp
@@ -34,12 +34,9 @@ string
IceUtilInternal::int64ToString(Int64 val)
{
char buf[64];
-#ifdef _WIN32
-# if defined(_MSC_VER)
+
+#if defined(_WIN32)
sprintf_s(buf, sizeof(buf), "%I64d", val);
-# else
- sprintf(buf, "%I64d", val);
-# endif
#elif defined(ICE_64)
sprintf(buf, "%ld", val); // Avoids a format warning from GCC.
#else
diff --git a/cpp/src/IceUtil/Random.cpp b/cpp/src/IceUtil/Random.cpp
index 68c125ebb25..1df50d27855 100644
--- a/cpp/src/IceUtil/Random.cpp
+++ b/cpp/src/IceUtil/Random.cpp
@@ -7,7 +7,7 @@
//
// **********************************************************************
-#ifdef _MSC_VER
+#ifdef _WIN32
# define _CRT_RAND_S
#endif
@@ -151,7 +151,7 @@ unsigned int
IceUtilInternal::random(int limit)
{
unsigned int r;
-#if defined(_MSC_VER)
+#ifdef _WIN32
errno_t err = rand_s(&r);
if(err != 0)
{
diff --git a/cpp/src/IceUtil/StringConverter.cpp b/cpp/src/IceUtil/StringConverter.cpp
index 1a6fe6e8405..19095c52a45 100644
--- a/cpp/src/IceUtil/StringConverter.cpp
+++ b/cpp/src/IceUtil/StringConverter.cpp
@@ -1,3 +1,16 @@
+// **********************************************************************
+//
+// Copyright (c) 2003-2014 ZeroC, Inc. All rights reserved.
+//
+// This copy of Ice is licensed to you under the terms described in the
+// ICE_LICENSE file included in this distribution.
+//
+// **********************************************************************
+
+#if defined(__MINGW32__) && !defined(_WIN32_WINNT)
+ // Windows Vista and up for WC_ERR_INVALID_CHARS
+ #define _WIN32_WINNT 0x0600
+#endif
#include <IceUtil/StringConverter.h>
#include <IceUtil/MutexPtrLock.h>