summaryrefslogtreecommitdiff
path: root/cpp/src
diff options
context:
space:
mode:
authorBernard Normier <bernard@zeroc.com>2004-01-23 22:37:27 +0000
committerBernard Normier <bernard@zeroc.com>2004-01-23 22:37:27 +0000
commite472963b0f661ca49b2c1f67fc17eb601923788b (patch)
treefb45d999b05a51060e29d806f214ed0186d9fb64 /cpp/src
parentfixes (diff)
downloadice-e472963b0f661ca49b2c1f67fc17eb601923788b.tar.bz2
ice-e472963b0f661ca49b2c1f67fc17eb601923788b.tar.xz
ice-e472963b0f661ca49b2c1f67fc17eb601923788b.zip
HP-UX port
Diffstat (limited to 'cpp/src')
-rw-r--r--cpp/src/Freeze/SharedDb.h9
-rw-r--r--cpp/src/Glacier/Blobject.cpp38
-rw-r--r--cpp/src/Ice/Application.cpp7
-rw-r--r--cpp/src/Ice/DynamicLibrary.cpp10
-rw-r--r--cpp/src/Ice/Incoming.cpp4
-rw-r--r--cpp/src/Ice/IncomingAsync.cpp4
-rw-r--r--cpp/src/Ice/Instance.cpp2
-rw-r--r--cpp/src/Ice/Network.h12
-rw-r--r--cpp/src/IceSSL/OpenSSLPluginI.cpp4
-rw-r--r--cpp/src/IceUtil/GCRecMutex.cpp7
-rw-r--r--cpp/src/IceUtil/GCShared.cpp7
-rw-r--r--cpp/src/IceUtil/InputUtil.cpp4
-rw-r--r--cpp/src/icecpp/cccp.c9
-rw-r--r--cpp/src/icecpp/config.h12
-rw-r--r--cpp/src/slice2cpp/Gen.cpp114
15 files changed, 159 insertions, 84 deletions
diff --git a/cpp/src/Freeze/SharedDb.h b/cpp/src/Freeze/SharedDb.h
index c6260ca8acb..c2fad563dd7 100644
--- a/cpp/src/Freeze/SharedDb.h
+++ b/cpp/src/Freeze/SharedDb.h
@@ -42,6 +42,15 @@ public:
const std::string&
dbName() const;
+#ifdef __HP_aCC
+
+ virtual int
+ get(DbTxn *txnid, Dbt *key, Dbt *data, u_int32_t flags)
+ {
+ ::Db::get(txnid, key, data, flags);
+ }
+#endif
+
private:
struct MapKey
diff --git a/cpp/src/Glacier/Blobject.cpp b/cpp/src/Glacier/Blobject.cpp
index e787c64f64a..15da41f95ee 100644
--- a/cpp/src/Glacier/Blobject.cpp
+++ b/cpp/src/Glacier/Blobject.cpp
@@ -95,11 +95,47 @@ Glacier::TwowayThrottle::twowayFinished()
}
}
+
+#ifdef __HP_aCC
+//
+// Compiler bug!
+// The conditional in Glacier::Blobject::Blobject below result in a
+// std::exception "thread synchronization error" at runtime
+// when using string litterals (looks like a RogueWave bug)
+// The work around is to use static strings:
+//
+
+static const string traceServer = "Glacier.Router.Trace.Server";
+static const string traceClient = "Glacier.Router.Trace.Client";
+
+static const string serverForwardContext = "Glacier.Router.Server.ForwardContext";
+static const string clientForwardContext = "Glacier.Router.Client.ForwardContext";
+
+static const string serverSleepTime = "Glacier.Router.Server.SleepTime";
+static const string clientSleepTime = "Glacier.Router.Client.SleepTime";
+#endif
+
Glacier::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse) :
_communicator(communicator),
_reverse(reverse),
_properties(_communicator->getProperties()),
_logger(_communicator->getLogger()),
+
+#ifdef __HP_aCC
+ //
+ // Compiler bug, see above
+ //
+ _traceLevel(_reverse ?
+ _properties->getPropertyAsInt(traceServer) :
+ _properties->getPropertyAsInt(traceClient)),
+ _forwardContext(_reverse ?
+ _properties->getPropertyAsInt(serverForwardContext) > 0 :
+ _properties->getPropertyAsInt(clientForwardContext) > 0),
+ _sleepTime(_reverse ?
+ IceUtil::Time::milliSeconds(_properties->getPropertyAsInt(serverSleepTime)) :
+ IceUtil::Time::milliSeconds(_properties->getPropertyAsInt(clientSleepTime))),
+
+#else
_traceLevel(_reverse ?
_properties->getPropertyAsInt("Glacier.Router.Trace.Server") :
_properties->getPropertyAsInt("Glacier.Router.Trace.Client")),
@@ -109,6 +145,8 @@ Glacier::Blobject::Blobject(const CommunicatorPtr& communicator, bool reverse) :
_sleepTime(_reverse ?
IceUtil::Time::milliSeconds(_properties->getPropertyAsInt("Glacier.Router.Server.SleepTime")) :
IceUtil::Time::milliSeconds(_properties->getPropertyAsInt("Glacier.Router.Client.SleepTime"))),
+#endif
+
_twowayThrottle(_communicator, _reverse)
{
_requestQueue = new RequestQueue(_communicator, _traceLevel, _reverse, _sleepTime);
diff --git a/cpp/src/Ice/Application.cpp b/cpp/src/Ice/Application.cpp
index ec318a5e20c..cb2bb9716a3 100644
--- a/cpp/src/Ice/Application.cpp
+++ b/cpp/src/Ice/Application.cpp
@@ -213,10 +213,12 @@ Ice::Application::main(int argc, char* argv[], const char* configFile)
cerr << _appName << ": " << ex << endl;
status = EXIT_FAILURE;
}
+ /*
catch(const std::exception& ex)
{
- cerr << _appName << ": std::exception: " << ex.what() << endl;
+ cerr << _appName << ": std::exception5: " << ex.what() << endl;
status = EXIT_FAILURE;
+ assert(0);
}
catch(const std::string& msg)
{
@@ -233,7 +235,8 @@ Ice::Application::main(int argc, char* argv[], const char* configFile)
cerr << _appName << ": unknown exception" << endl;
status = EXIT_FAILURE;
}
-
+ */
+
if(_communicator)
{
//
diff --git a/cpp/src/Ice/DynamicLibrary.cpp b/cpp/src/Ice/DynamicLibrary.cpp
index 058ee6d5251..31705c32f49 100644
--- a/cpp/src/Ice/DynamicLibrary.cpp
+++ b/cpp/src/Ice/DynamicLibrary.cpp
@@ -92,6 +92,16 @@ IceInternal::DynamicLibrary::loadEntryPoint(const string& entryPoint, bool useIc
lib += 'd';
# endif
lib += ".dll";
+#elif defined(__hpux)
+ lib = "lib" + libName;
+ if(!version.empty())
+ {
+ lib += "." + version;
+ }
+ else
+ {
+ lib += ".sl";
+ }
#else
lib = "lib" + libName + ".so";
if(!version.empty())
diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp
index 6610a8e5e59..f282cedb669 100644
--- a/cpp/src/Ice/Incoming.cpp
+++ b/cpp/src/Ice/Incoming.cpp
@@ -319,7 +319,7 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager)
{
if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
{
- __warning(string("std::exception: ") + ex.what());
+ __warning(string("std::exception3: ") + ex.what());
}
if(_response)
@@ -328,7 +328,7 @@ IceInternal::Incoming::invoke(const ServantManagerPtr& servantManager)
_os.b.resize(headerSize + 4); // Dispatch status position.
_os.write(static_cast<Byte>(DispatchUnknownException));
ostringstream str;
- str << "std::exception: " << ex.what();
+ str << "std::exception4: " << ex.what();
_os.write(str.str());
}
diff --git a/cpp/src/Ice/IncomingAsync.cpp b/cpp/src/Ice/IncomingAsync.cpp
index 80cdc47997c..55999e70949 100644
--- a/cpp/src/Ice/IncomingAsync.cpp
+++ b/cpp/src/Ice/IncomingAsync.cpp
@@ -182,7 +182,7 @@ IceInternal::IncomingAsync::__exception(const std::exception& ex)
if(_os.instance()->properties()->getPropertyAsIntWithDefault("Ice.Warn.Dispatch", 1) > 0)
{
- __warning(string("std::exception: ") + ex.what());
+ __warning(string("std::exception1: ") + ex.what());
}
if(_response)
@@ -191,7 +191,7 @@ IceInternal::IncomingAsync::__exception(const std::exception& ex)
_os.b.resize(headerSize + 4); // Dispatch status position.
_os.write(static_cast<Byte>(DispatchUnknownException));
ostringstream str;
- str << "std::exception: " << ex.what();
+ str << "std::exception2: " << ex.what();
_os.write(str.str());
}
diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp
index b0de2288ce6..e9e29f8d68b 100644
--- a/cpp/src/Ice/Instance.cpp
+++ b/cpp/src/Ice/Instance.cpp
@@ -627,7 +627,7 @@ IceInternal::Instance::finishSetup(int& argc, char* argv[])
LocatorPrx::uncheckedCast(_proxyFactory->stringToProxy(_defaultsAndOverrides->defaultLocator)));
}
-#if !defined(_WIN32) && !defined(__sun)
+#if !defined(_WIN32) && !defined(__sun) && !defined(__hpux)
//
// daemon() must be called after any plug-ins have been
// installed. For example, an SSL plug-in might want to
diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h
index d0db8d92527..83568571088 100644
--- a/cpp/src/Ice/Network.h
+++ b/cpp/src/Ice/Network.h
@@ -15,6 +15,10 @@
#ifndef ICE_NETWORK_H
#define ICE_NETWORK_H
+#ifdef __hpux
+# define _XOPEN_SOURCE_EXTENDED
+#endif
+
#include <Ice/Config.h>
#ifdef _WIN32
@@ -24,7 +28,13 @@ typedef int ssize_t;
# include <unistd.h>
# include <fcntl.h>
# include <sys/socket.h>
-# include <sys/select.h>
+
+# if defined(__hpux)
+# include <sys/time.h>
+# else
+# include <sys/select.h>
+# endif
+
# include <netinet/in.h>
# include <netinet/tcp.h>
# include <arpa/inet.h>
diff --git a/cpp/src/IceSSL/OpenSSLPluginI.cpp b/cpp/src/IceSSL/OpenSSLPluginI.cpp
index 6adc65674e2..d9dfcf39c2c 100644
--- a/cpp/src/IceSSL/OpenSSLPluginI.cpp
+++ b/cpp/src/IceSSL/OpenSSLPluginI.cpp
@@ -156,9 +156,9 @@ idFunction()
// On FreeBSD, pthread_t is a pointer to a per-thread structure
//
return reinterpret_cast<unsigned long>(pthread_self());
-#elif (defined(__linux) || defined(__sun))
+#elif (defined(__linux) || defined(__sun) || defined(__hpux))
//
- // On Linux and Solaris, pthread_t is an integer
+ // On Linux, Solaris and HP-UX, pthread_t is an integer
//
return static_cast<unsigned long>(pthread_self());
#else
diff --git a/cpp/src/IceUtil/GCRecMutex.cpp b/cpp/src/IceUtil/GCRecMutex.cpp
index 1cb20dc190a..d474573b3d8 100644
--- a/cpp/src/IceUtil/GCRecMutex.cpp
+++ b/cpp/src/IceUtil/GCRecMutex.cpp
@@ -14,9 +14,12 @@
#include <IceUtil/GCRecMutex.h>
-using namespace IceUtil;
+namespace IceUtil
+{
+GCRecMutex gcRecMutex;
+}
-GCRecMutex ICE_UTIL_API IceUtil::gcRecMutex;
+using namespace IceUtil;
static int gcInitCount = 0;
diff --git a/cpp/src/IceUtil/GCShared.cpp b/cpp/src/IceUtil/GCShared.cpp
index 51705f7a655..5a92cdaeb76 100644
--- a/cpp/src/IceUtil/GCShared.cpp
+++ b/cpp/src/IceUtil/GCShared.cpp
@@ -15,9 +15,12 @@
#include <IceUtil/GCRecMutex.h>
#include <IceUtil/GCShared.h>
-using namespace IceUtil;
+namespace IceUtil
+{
+GCObjectSet gcObjects;
+}
-IceUtil::GCObjectSet IceUtil::gcObjects;
+using namespace IceUtil;
IceUtil::GCShared::GCShared()
: _ref(0), _noDelete(false)
diff --git a/cpp/src/IceUtil/InputUtil.cpp b/cpp/src/IceUtil/InputUtil.cpp
index cee85b3a152..128b5d93507 100644
--- a/cpp/src/IceUtil/InputUtil.cpp
+++ b/cpp/src/IceUtil/InputUtil.cpp
@@ -150,6 +150,10 @@ strToInt64(const char* s, char** endptr, int base)
return result;
+#elif defined(ICE_64)
+ return strtol(s, endptr, base);
+#elif defined(__hpux)
+ return __strtoll(s, endptr, base);
#else
return strtoll(s, endptr, base);
#endif
diff --git a/cpp/src/icecpp/cccp.c b/cpp/src/icecpp/cccp.c
index 2585eeb3e87..cfdc6480cb3 100644
--- a/cpp/src/icecpp/cccp.c
+++ b/cpp/src/icecpp/cccp.c
@@ -200,7 +200,8 @@ static void hack_vms_include_specification ();
/* External declarations. */
-extern char *version_string;
+/* extern char *version_string; */
+
extern char *update_path PROTO((char *, char *));
//#ifndef VMS
//#ifndef HAVE_STRERROR
@@ -2265,7 +2266,7 @@ index0 (s, c, n)
{
char *p = (char *) s;
for (;;) {
- char *q = index (p, c);
+ char *q = (char*) index (p, c);
if (q)
return (U_CHAR *) q;
else {
@@ -4642,7 +4643,7 @@ base_name (fname)
if (s != fname)
return s;
#endif
- if ((p = rindex (s, '/'))) s = p + 1;
+ if ((p = (char*) rindex (s, '/'))) s = p + 1;
#ifdef DIR_SEPARATOR
if ((p = rindex (s, DIR_SEPARATOR))) s = p + 1;
#endif
@@ -5227,7 +5228,7 @@ check_preconditions (prec)
char *lineend;
while (*prec) {
- lineend = index (prec, '\n');
+ lineend = (char*) index (prec, '\n');
if (*prec++ != '#') {
error ("Bad format encountered while reading precompiled file");
diff --git a/cpp/src/icecpp/config.h b/cpp/src/icecpp/config.h
index 324f2149d34..a78e3151a22 100644
--- a/cpp/src/icecpp/config.h
+++ b/cpp/src/icecpp/config.h
@@ -17,7 +17,7 @@
// configure script from the gcc-2.8.1 distribution.
//
-#if defined(__linux) || defined(__FreeBSD__) || defined(__sun)
+#if defined(__linux) || defined(__FreeBSD__) || defined(__sun) || defined(__hpux)
# define HAVE_INTTYPES_H 1
# define TIME_WITH_SYS_TIME 1
# define HAVE_BCMP 1
@@ -35,6 +35,10 @@
# define alloca _alloca
#endif
+#if defined(__hpux)
+#include <alloca.h>
+#endif
+
#if defined(__sun)
#include <alloca.h>
#include <malloc.h>
@@ -57,10 +61,8 @@
#define LONG_TYPE_SIZE 4
#if defined(_WIN32)
# define WCHAR_TYPE_SIZE 2
-#elif (defined(__linux) || defined(__FreeBSD__)) && (defined(__i386) || defined(__x86_64)) \
- || defined (__sun)
-# define WCHAR_TYPE_SIZE 4
-#elif defined(__linux) && defined(__sparc__)
+#elif (defined(__linux) || defined(__FreeBSD__)) && (defined(__i386) || defined(__x86_64) || defined(__sparc)) \
+ || defined (__sun) || defined(__hpux)
# define WCHAR_TYPE_SIZE 4
#else
# error "unsupported operating system or platform"
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 55728f17ef1..76f69cfce5e 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -2322,7 +2322,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
H << sp << nl << "void " << _dllExport << "__patch__" << name << "Ptr(void*, ::Ice::ObjectPtr&);";
C << sp << nl << "void " << _dllExport;
- C << nl << scope << "__patch__" << name << "Ptr(void* __addr, ::Ice::ObjectPtr& v)";
+ C << nl << scope.substr(2) << "__patch__" << name << "Ptr(void* __addr, ::Ice::ObjectPtr& v)";
C << sb;
C << nl << scope << name << "Ptr* p = static_cast< " << scope << name << "Ptr*>(__addr);";
C << nl << "assert(p);";
@@ -2677,10 +2677,8 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
|| ClassDeclPtr::dynamicCast(p))
{
C << nl << "__addObject(_c, " << prefix << name << ".get());";
- return;
}
-
- if(StructPtr s = StructPtr::dynamicCast(p))
+ else if(StructPtr s = StructPtr::dynamicCast(p))
{
DataMemberList dml = s->dataMembers();
for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i)
@@ -2690,10 +2688,8 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
emitGCInsertCode((*i)->type(), prefix + name + ".", fixKwd((*i)->name()), ++level);
}
}
- return;
}
-
- if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
+ else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
{
string scoped = fixKwd(d->scoped());
stringstream tmp;
@@ -2706,10 +2702,8 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
emitGCInsertCode(d->valueType(), "", string("(*") + iterName + ").second", ++level);
C << eb;
C << eb;
- return;
}
-
- if(SequencePtr s = SequencePtr::dynamicCast(p))
+ else if(SequencePtr s = SequencePtr::dynamicCast(p))
{
string scoped = fixKwd(s->scoped());
stringstream tmp;
@@ -2722,7 +2716,6 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref
emitGCInsertCode(s->type(), string("(*") + iterName + ")", "", ++level);
C << eb;
C << eb;
- return;
}
}
@@ -2737,10 +2730,8 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
C << nl << prefix << name << "->__decRefUnsafe();";
C << nl << prefix << name << ".__clearHandleUnsafe();";
C << eb;
- return;
}
-
- if(StructPtr s = StructPtr::dynamicCast(p))
+ else if(StructPtr s = StructPtr::dynamicCast(p))
{
DataMemberList dml = s->dataMembers();
for(DataMemberList::const_iterator i = dml.begin(); i != dml.end(); ++i)
@@ -2750,10 +2741,8 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
emitGCClearCode((*i)->type(), prefix + name + ".", fixKwd((*i)->name()), ++level);
}
}
- return;
}
-
- if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
+ else if(DictionaryPtr d = DictionaryPtr::dynamicCast(p))
{
string scoped = fixKwd(d->scoped());
stringstream tmp;
@@ -2766,10 +2755,8 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
emitGCClearCode(d->valueType(), "", string("(*") + iterName + ").second", ++level);
C << eb;
C << eb;
- return;
}
-
- if(SequencePtr s = SequencePtr::dynamicCast(p))
+ else if(SequencePtr s = SequencePtr::dynamicCast(p))
{
string scoped = fixKwd(s->scoped());
stringstream tmp;
@@ -2781,8 +2768,7 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi
C << sb;
emitGCClearCode(s->type(), "", string("(*") + iterName + ")", ++level);
C << eb;
- C << eb;
- return;
+ C << eb;;
}
}
@@ -3140,48 +3126,54 @@ Slice::Gen::ImplVisitor::writeReturn(Output& out, const TypePtr& type)
break;
}
}
- return;
- }
-
- ProxyPtr prx = ProxyPtr::dynamicCast(type);
- if(prx)
- {
- out << nl << "return 0;";
- return;
- }
-
- ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
- if(cl)
- {
- out << nl << "return 0;";
- return;
- }
-
- StructPtr st = StructPtr::dynamicCast(type);
- if(st)
- {
- out << nl << "return " << fixKwd(st->scoped()) << "();";
- return;
}
-
- EnumPtr en = EnumPtr::dynamicCast(type);
- if(en)
- {
- EnumeratorList enumerators = en->getEnumerators();
- out << nl << "return " << fixKwd(en->scope()) << fixKwd(enumerators.front()->name()) << ';';
- return;
- }
-
- SequencePtr seq = SequencePtr::dynamicCast(type);
- if(seq)
+ else
{
- out << nl << "return " << fixKwd(seq->scoped()) << "();";
- return;
+ ProxyPtr prx = ProxyPtr::dynamicCast(type);
+ if(prx)
+ {
+ out << nl << "return 0;";
+ }
+ else
+ {
+ ClassDeclPtr cl = ClassDeclPtr::dynamicCast(type);
+ if(cl)
+ {
+ out << nl << "return 0;";
+ }
+ else
+ {
+ StructPtr st = StructPtr::dynamicCast(type);
+ if(st)
+ {
+ out << nl << "return " << fixKwd(st->scoped()) << "();";
+ }
+ else
+ {
+ EnumPtr en = EnumPtr::dynamicCast(type);
+ if(en)
+ {
+ EnumeratorList enumerators = en->getEnumerators();
+ out << nl << "return " << fixKwd(en->scope()) << fixKwd(enumerators.front()->name()) << ';';
+ }
+ else
+ {
+ SequencePtr seq = SequencePtr::dynamicCast(type);
+ if(seq)
+ {
+ out << nl << "return " << fixKwd(seq->scoped()) << "();";
+ }
+ else
+ {
+ DictionaryPtr dict = DictionaryPtr::dynamicCast(type);
+ assert(dict);
+ out << nl << "return " << fixKwd(dict->scoped()) << "();";
+ }
+ }
+ }
+ }
+ }
}
-
- DictionaryPtr dict = DictionaryPtr::dynamicCast(type);
- assert(dict);
- out << nl << "return " << fixKwd(dict->scoped()) << "();";
}
bool