summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichi Henning <michi@zeroc.com>2002-10-28 06:25:27 +0000
committerMichi Henning <michi@zeroc.com>2002-10-28 06:25:27 +0000
commit382f7ebc87fc0d1056e257b83963d1903f7e8d27 (patch)
tree4c390abfa4a5d507ae044106619b5533232d2b14
parentchanging Mutable Realms to ZeroC (diff)
downloadice-382f7ebc87fc0d1056e257b83963d1903f7e8d27.tar.bz2
ice-382f7ebc87fc0d1056e257b83963d1903f7e8d27.tar.xz
ice-382f7ebc87fc0d1056e257b83963d1903f7e8d27.zip
First shot at porting to VC++ 2002. Code compiles, but suffers random
crashes during the tests.
-rw-r--r--cpp/include/Ice/RoutingTable.h1
-rw-r--r--cpp/include/IceUtil/Monitor.h2
-rw-r--r--cpp/src/Ice/DynamicLibrary.cpp8
-rw-r--r--cpp/src/Ice/Network.cpp4
-rw-r--r--cpp/src/IceSSL/OpenSSLPluginI.cpp3
-rw-r--r--cpp/src/IceUtil/ThreadException.cpp2
-rw-r--r--cpp/src/IceUtil/UUID.cpp7
-rw-r--r--cpp/test/XMLTransform/transform/Populate.cpp2
8 files changed, 20 insertions, 9 deletions
diff --git a/cpp/include/Ice/RoutingTable.h b/cpp/include/Ice/RoutingTable.h
index a7d15884b13..bf6fb0bfb96 100644
--- a/cpp/include/Ice/RoutingTable.h
+++ b/cpp/include/Ice/RoutingTable.h
@@ -15,6 +15,7 @@
#include <IceUtil/Mutex.h>
#include <Ice/RoutingTableF.h>
#include <Ice/ProxyF.h>
+#include <Ice/Identity.h>
namespace Ice
{
diff --git a/cpp/include/IceUtil/Monitor.h b/cpp/include/IceUtil/Monitor.h
index 736eb4c20f4..8a23018447e 100644
--- a/cpp/include/IceUtil/Monitor.h
+++ b/cpp/include/IceUtil/Monitor.h
@@ -24,7 +24,7 @@ namespace IceUtil
// unlocked.
//
template <class T>
-class ICE_UTIL_API Monitor
+class Monitor
{
public:
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 6d7ca2aeaf5..19a4ba3c930 100644
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -96,8 +96,12 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint)
bool
IceInternal::DynamicLibrary::load(const string& lib)
{
-#ifdef _WIN32
- _hnd = LoadLibrary(lib.c_str());
+#ifdef _WIN32
+#if _MSC_VER == 1200
+ _hnd = LoadLibrary(lib.c_str());
+#else
+ _hnd = LoadLibrary((LPCWSTR)lib.c_str()); // Type changed in VC++ 2002
+#endif
#else
_hnd = dlopen(lib.c_str(), RTLD_NOW);
if(_hnd == 0)
diff --git a/cpp/src/Ice/Network.cpp b/cpp/src/Ice/Network.cpp
index 438c22dc958..7467b164511 100644
--- a/cpp/src/Ice/Network.cpp
+++ b/cpp/src/Ice/Network.cpp
@@ -743,8 +743,8 @@ IceInternal::errorToString(int error)
if(ok)
{
LPCTSTR msg = (LPCTSTR)lpMsgBuf;
- assert(msg && strlen(msg) > 0);
- string result = msg;
+ assert(msg && strlen((const char*)msg) > 0);
+ string result = (const char*)msg;
LocalFree(lpMsgBuf);
return result;
}
diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp
index 1da7bdaa24e..09a957d605a 100644
--- a/cpp/src/IceSSL/OpenSSLPluginI.cpp
+++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp
@@ -68,7 +68,8 @@ create(const CommunicatorPtr& communicator, const string& name, const StringSeq&
catch (...)
{
Ice::PluginPtr ptr = plugin; // Reclaim the plug-in instance
- throw;
+ // TODO: can't throw from an extern "C" function
+ // throw;
}
//
diff --git a/cpp/src/IceUtil/ThreadException.cpp b/cpp/src/IceUtil/ThreadException.cpp
index d4cee046c2b..7f7a0074acf 100644
--- a/cpp/src/IceUtil/ThreadException.cpp
+++ b/cpp/src/IceUtil/ThreadException.cpp
@@ -50,7 +50,7 @@ IceUtil::ThreadSyscallException::ice_print(ostream& os) const
if(ok)
{
LPCTSTR msg = (LPCTSTR)lpMsgBuf;
- assert(msg && strlen(msg) > 0);
+ assert(msg && strlen((char*)msg) > 0);
os << msg;
LocalFree(lpMsgBuf);
}
diff --git a/cpp/src/IceUtil/UUID.cpp b/cpp/src/IceUtil/UUID.cpp
index 9ec636057d9..7b2ea932377 100644
--- a/cpp/src/IceUtil/UUID.cpp
+++ b/cpp/src/IceUtil/UUID.cpp
@@ -28,8 +28,13 @@ IceUtil::generateUUID()
UUID uuid;
UuidCreate(&uuid);
+
+#if _MSC_VER == 1200
+ unsigned char* str;
+#else
+ unsigned short* str; // Type has changed for some reason in VC++ 2002 (but doc still
+#endif // says it's unsigned char *...)
- unsigned char* str;
UuidToString(&uuid, &str);
string result(reinterpret_cast<char*>(str));
diff --git a/cpp/test/XMLTransform/transform/Populate.cpp b/cpp/test/XMLTransform/transform/Populate.cpp
index d75efb2de00..b79075fd56e 100644
--- a/cpp/test/XMLTransform/transform/Populate.cpp
+++ b/cpp/test/XMLTransform/transform/Populate.cpp
@@ -172,7 +172,7 @@ transformPrimitive(const DBEnvironmentPtr& dbEnv)
IntFloatMap map(db);
for(i = 0; i < NUM_KEYS; i++)
{
- map.insert(make_pair(i, i));
+ map.insert(make_pair(i, static_cast<float>(i)));
}
}