diff --git cpp.old/allTests.py cpp/allTests.py index 33b7d88..8a5effd 100755 --- cpp/allTests.py +++ cpp.orig/allTests.py @@ -25,6 +25,7 @@ from scripts import * # List of all basic tests. # tests = [ + ("IceUtil/condvar", ["once", "win32only"]), ("IceUtil/thread", ["once"]), ("IceUtil/unicode", ["once"]), @@ -62,7 +63,7 @@ tests = [ ("Ice/servantLocator", ["core"]), ("Ice/interceptor", ["core"]), ("Ice/stringConverter", ["core"]), - ("Ice/udp", ["core"]), + ("Ice/udp", ["core", "nofreebsdjail"]), ("Ice/defaultServant", ["core"]), ("Ice/defaultValue", ["core"]), ("Ice/invoke", ["core", "novc6"]), @@ -106,8 +107,8 @@ tests = [ # if TestUtil.isWin32() or os.getuid() == 0: tests += [ - ("IceUtil/priority", ["core", "nodarwin"]), - ("Ice/threadPoolPriority", ["core", "nodarwin"]) + ("IceUtil/priority", ["core", "nodarwin", "nofreebsd"]), + ("Ice/threadPoolPriority", ["core", "nodarwin", "nofreebsd"]) ] if __name__ == "__main__": diff --git cpp.old/include/Freeze/Map.h cpp/include/Freeze/Map.h index 2ec759d..263e8fa 100644 --- cpp/include/Freeze/Map.h +++ cpp.orig/include/Freeze/Map.h @@ -426,7 +426,7 @@ public: ConstIterator(MapHelper& mapHelper, const Ice::CommunicatorPtr& communicator) : _helper(IteratorHelper::create(mapHelper, true)), - _communicator(_communicator), + _communicator(communicator), _refValid(false) { } diff --git cpp.old/include/Ice/ConnectionIF.h cpp/include/Ice/ConnectionIF.h index ca954c0..81ceb01 100644 --- cpp/include/Ice/ConnectionIF.h +++ cpp.orig/include/Ice/ConnectionIF.h @@ -17,13 +17,13 @@ namespace Ice { class ConnectionI; +ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*); } namespace IceInternal { -ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*); enum AsyncStatus { diff --git cpp.old/include/Ice/IncomingAsyncF.h cpp/include/Ice/IncomingAsyncF.h index 7d9228a..d861180 100644 --- cpp/include/Ice/IncomingAsyncF.h +++ cpp.orig/include/Ice/IncomingAsyncF.h @@ -28,12 +28,6 @@ namespace Ice class AMD_Object_ice_invoke; class AMD_Array_Object_ice_invoke; - -} - -namespace IceInternal -{ - ICE_API IceUtil::Shared* upCast(::Ice::AMD_Object_ice_invoke*); ICE_API IceUtil::Shared* upCast(::Ice::AMD_Array_Object_ice_invoke*); diff --git cpp.old/include/Ice/LocalObjectF.h cpp/include/Ice/LocalObjectF.h index 69a28d3..6e613b7 100644 --- cpp/include/Ice/LocalObjectF.h +++ cpp.orig/include/Ice/LocalObjectF.h @@ -18,12 +18,6 @@ namespace Ice { class LocalObject; - -} - -namespace IceInternal -{ - ICE_API IceUtil::Shared* upCast(::Ice::LocalObject*); } diff --git cpp.old/include/Ice/ObjectF.h cpp/include/Ice/ObjectF.h index eaabadd..2baff11 100644 --- cpp/include/Ice/ObjectF.h +++ cpp.orig/include/Ice/ObjectF.h @@ -17,19 +17,8 @@ namespace Ice { class Object; - -} - -namespace IceInternal -{ - ICE_API IceUtil::Shared* upCast(::Ice::Object*); -} - -namespace Ice -{ - typedef IceInternal::Handle< Object > ObjectPtr; void ICE_API __patch__ObjectPtr(void*, ObjectPtr&); diff --git cpp.old/include/Ice/OutgoingAsyncF.h cpp/include/Ice/OutgoingAsyncF.h index 0e9398c..334ca7a 100644 --- cpp/include/Ice/OutgoingAsyncF.h +++ cpp.orig/include/Ice/OutgoingAsyncF.h @@ -19,13 +19,13 @@ namespace Ice class AsyncResult; typedef IceInternal::Handle AsyncResultPtr; +ICE_API IceUtil::Shared* upCast(::Ice::AsyncResult*); } namespace IceInternal { -ICE_API IceUtil::Shared* upCast(::Ice::AsyncResult*); class OutgoingAsync; ICE_API IceUtil::Shared* upCast(OutgoingAsync*); diff --git cpp.old/include/Ice/Proxy.h cpp/include/Ice/Proxy.h index 250c700..0ae9e72 100644 --- cpp/include/Ice/Proxy.h +++ cpp.orig/include/Ice/Proxy.h @@ -38,6 +38,8 @@ namespace Ice class Locator; class Router; +ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Locator*); +ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Router*); } @@ -46,8 +48,6 @@ class Router; namespace IceInternal { -ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Locator*); -ICE_API ::IceProxy::Ice::Object* upCast(::IceProxy::Ice::Router*); class LocalExceptionWrapper; @@ -1172,7 +1172,7 @@ public: TwowayCallbackNC(const TPtr& instance, bool cb, Exception excb, Sent sentcb) : CallbackNC(instance, excb, sentcb) { - checkCallback(instance, cb || excb != 0); + this->checkCallback(instance, cb || excb != 0); } }; @@ -1188,7 +1188,7 @@ public: TwowayCallback(const TPtr& instance, bool cb, Exception excb, Sent sentcb) : Callback(instance, excb, sentcb) { - checkCallback(instance, cb || excb != 0); + this->checkCallback(instance, cb || excb != 0); } }; @@ -1209,7 +1209,7 @@ public: OnewayCallbackNC(const TPtr& instance, Response cb, Exception excb, Sent sentcb) : CallbackNC(instance, excb, sentcb), response(cb) { - checkCallback(instance, cb != 0 || excb != 0); + this->checkCallback(instance, cb != 0 || excb != 0); } virtual void __completed(const ::Ice::AsyncResultPtr& result) const @@ -1254,7 +1254,7 @@ public: OnewayCallback(const TPtr& instance, Response cb, Exception excb, Sent sentcb) : Callback(instance, excb, sentcb), response(cb) { - checkCallback(instance, cb != 0 || excb != 0); + this->checkCallback(instance, cb != 0 || excb != 0); } virtual void __completed(const ::Ice::AsyncResultPtr& result) const diff --git cpp.old/include/Ice/ProxyF.h cpp/include/Ice/ProxyF.h index 27b7ec6..67b2b05 100644 --- cpp/include/Ice/ProxyF.h +++ cpp.orig/include/Ice/ProxyF.h @@ -22,6 +22,11 @@ namespace Ice { class Object; +inline ::IceProxy::Ice::Object* +upCast(::IceProxy::Ice::Object* o) +{ + return o; +} } @@ -34,6 +39,11 @@ namespace Ice { class Object; +inline ::IceDelegate::Ice::Object* +upCast(::IceDelegate::Ice::Object* o) +{ + return o; +} } @@ -47,6 +57,12 @@ namespace Ice class Object; +inline ::IceDelegateM::Ice::Object* +upCast(::IceDelegateM::Ice::Object* o) +{ + return o; +} + } } @@ -58,36 +74,12 @@ namespace Ice { class Object; - -} - -} - -namespace IceInternal -{ - -inline ::IceProxy::Ice::Object* -upCast(::IceProxy::Ice::Object* o) -{ - return o; -} - -inline ::IceDelegate::Ice::Object* -upCast(::IceDelegate::Ice::Object* o) -{ - return o; -} - inline ::IceDelegateD::Ice::Object* upCast(::IceDelegateD::Ice::Object* o) { return o; } -inline ::IceDelegateM::Ice::Object* -upCast(::IceDelegateM::Ice::Object* o) -{ - return o; } } diff --git cpp.old/include/Ice/Stream.h cpp/include/Ice/Stream.h index 40cd611..36ab56b 100644 --- cpp/include/Ice/Stream.h +++ cpp.orig/include/Ice/Stream.h @@ -17,6 +17,12 @@ #include #include +namespace IceInternal +{ + // Forward declaration required for writer specializations. + void delegateThrowMarshalException(const char*, int, const ::std::string&); +} + namespace Ice { @@ -45,9 +51,6 @@ enum StreamTraitType StreamTraitTypeUnknown }; -// Forward declaration required for writer specializations. -class MarshalException; - // // Base trait template. This doesn't actually do anything -- we just // use it as a template that we can specialize. @@ -542,7 +545,7 @@ struct StreamWriter { if(static_cast(v) < 0 || static_cast(v) >= StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } outS->write(static_cast(v)); } @@ -558,7 +561,7 @@ struct StreamReader inS->read(val); if(val > StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } v = static_cast(val); } @@ -573,7 +576,7 @@ struct StreamWriter { if(static_cast(v) < 0 || static_cast(v) >= StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } outS->write(static_cast(v)); } @@ -589,7 +592,7 @@ struct StreamReader inS->read(val); if(val < 0 || val > StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } v = static_cast(val); } @@ -603,7 +606,7 @@ struct StreamWriter { if(static_cast(v) < 0 || static_cast(v) >= StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } outS->write(static_cast(v)); } @@ -619,7 +622,7 @@ struct StreamReader inS->read(val); if(val < 0 || val > StreamTrait::enumLimit) { - throw MarshalException(__FILE__, __LINE__, "enumerator out of range"); + IceInternal::delegateThrowMarshalException(__FILE__, __LINE__, "enumerator out of range"); } v = static_cast(val); } diff --git cpp.old/include/Ice/StreamF.h cpp/include/Ice/StreamF.h index d94ba2b..f114206 100644 --- cpp/include/Ice/StreamF.h +++ cpp.orig/include/Ice/StreamF.h @@ -19,12 +19,6 @@ namespace Ice class InputStream; class OutputStream; - -} - -namespace IceInternal -{ - ICE_API IceUtil::Shared* upCast(::Ice::InputStream*); ICE_API IceUtil::Shared* upCast(::Ice::OutputStream*); diff --git cpp.old/src/Freeze/MapDb.cpp cpp/src/Freeze/MapDb.cpp index ad573cf..397151e 100644 --- cpp/src/Freeze/MapDb.cpp +++ cpp.orig/src/Freeze/MapDb.cpp @@ -229,7 +229,11 @@ Freeze::MapDb::MapDb(const ConnectionIPtr& connection, #ifndef NDEBUG bool inserted = #endif - _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())).second; + _indices.insert(IndexMap::value_type(indexBase->name(), indexI.get())) +#ifndef NDEBUG + .second +#endif + ; assert(inserted); indexBase->_impl = indexI.release(); diff --git cpp.old/src/Freeze/MapI.cpp cpp/src/Freeze/MapI.cpp index c7f0719..83f3ceb 100644 --- cpp/src/Freeze/MapI.cpp +++ cpp.orig/src/Freeze/MapI.cpp @@ -1023,7 +1023,11 @@ Freeze::MapHelperI::MapHelperI(const ConnectionIPtr& connection, #ifndef NDEBUG bool inserted = #endif - _indices.insert(IndexMap::value_type(indexBase->name(), indexBase)).second; + _indices.insert(IndexMap::value_type(indexBase->name(), indexBase)) +#ifndef NDEBUG + .second +#endif + ; assert(inserted); indexBase->_map = this; } diff --git cpp.old/src/Ice/ConnectionI.cpp cpp/src/Ice/ConnectionI.cpp index 2d942ca..34317d9 100644 --- cpp/src/Ice/ConnectionI.cpp +++ cpp.orig/src/Ice/ConnectionI.cpp @@ -31,7 +31,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -Ice::LocalObject* IceInternal::upCast(ConnectionI* p) { return p; } +Ice::LocalObject* Ice::upCast(ConnectionI* p) { return p; } namespace { diff --git cpp.old/src/Ice/IncomingAsync.cpp cpp/src/Ice/IncomingAsync.cpp index ca108ee..91c0580 100644 --- cpp/src/Ice/IncomingAsync.cpp +++ cpp.orig/src/Ice/IncomingAsync.cpp @@ -24,7 +24,7 @@ using namespace Ice; using namespace IceInternal; IceUtil::Shared* IceInternal::upCast(IncomingAsync* p) { return p; } -IceUtil::Shared* IceInternal::upCast(AMD_Object_ice_invoke* p) { return p; } +IceUtil::Shared* Ice::upCast(AMD_Object_ice_invoke* p) { return p; } namespace { diff --git cpp.old/src/Ice/LocalObject.cpp cpp/src/Ice/LocalObject.cpp index 77bee3d..ee74c0b 100644 --- cpp/src/Ice/LocalObject.cpp +++ cpp.orig/src/Ice/LocalObject.cpp @@ -13,7 +13,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Shared* IceInternal::upCast(LocalObject* obj) { return obj; } +IceUtil::Shared* Ice::upCast(LocalObject* obj) { return obj; } bool Ice::LocalObject::operator==(const LocalObject& r) const diff --git cpp.old/src/Ice/Object.cpp cpp/src/Ice/Object.cpp index fa7793a..9705ce9 100644 --- cpp/src/Ice/Object.cpp +++ cpp.orig/src/Ice/Object.cpp @@ -19,7 +19,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Shared* IceInternal::upCast(Object* p) { return p; } +IceUtil::Shared* Ice::upCast(Object* p) { return p; } bool Ice::Object::operator==(const Object& r) const diff --git cpp.old/src/Ice/OutgoingAsync.cpp cpp/src/Ice/OutgoingAsync.cpp index 527d29c..d707321 100644 --- cpp/src/Ice/OutgoingAsync.cpp +++ cpp.orig/src/Ice/OutgoingAsync.cpp @@ -30,7 +30,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Shared* IceInternal::upCast(AsyncResult* p) { return p; } +IceUtil::Shared* Ice::upCast(AsyncResult* p) { return p; } IceUtil::Shared* IceInternal::upCast(OutgoingAsyncMessageCallback* p) { return p; } IceUtil::Shared* IceInternal::upCast(OutgoingAsync* p) { return p; } diff --git cpp.old/src/Ice/Stream.cpp cpp/src/Ice/Stream.cpp index 9924da0..2ecdc08 100644 --- cpp/src/Ice/Stream.cpp +++ cpp.orig/src/Ice/Stream.cpp @@ -8,10 +8,19 @@ // ********************************************************************** #include +#include using namespace std; using namespace Ice; using namespace IceInternal; -IceUtil::Shared* IceInternal::upCast(InputStream* p) { return p; } -IceUtil::Shared* IceInternal::upCast(OutputStream* p) { return p; } +IceUtil::Shared* Ice::upCast(InputStream* p) { return p; } +IceUtil::Shared* Ice::upCast(OutputStream* p) { return p; } + +namespace IceInternal +{ + void delegateThrowMarshalException(const char* file, int line , const ::std::string& message) + { + throw Ice::MarshalException(file, line, message); + } +} diff --git cpp.old/src/IceGrid/AdminCallbackRouter.cpp cpp/src/IceGrid/AdminCallbackRouter.cpp index e4d21ef..ce63c9f 100644 --- cpp/src/IceGrid/AdminCallbackRouter.cpp +++ cpp.orig/src/IceGrid/AdminCallbackRouter.cpp @@ -49,7 +49,12 @@ IceGrid::AdminCallbackRouter::addMapping(const string& category, const Connectio #ifndef NDEBUG bool inserted = #endif - _categoryToConnection.insert(map::value_type(category, con)).second; + _categoryToConnection.insert(map::value_type(category, con)) +#ifndef NDEBUG + .second +#endif + ; + assert(inserted == true); } diff --git cpp.old/src/IceGrid/DescriptorHelper.cpp cpp/src/IceGrid/DescriptorHelper.cpp index 9126c2f..0bc0111 100644 --- cpp/src/IceGrid/DescriptorHelper.cpp +++ cpp.orig/src/IceGrid/DescriptorHelper.cpp @@ -198,15 +198,6 @@ updateSeqElts(const Seq& seq, const Seq& update, const Ice::StringSeq& remove, G return result; } -template Dict -getDictUpdatedElts(const Dict& ldict, const Dict& rdict) -{ -#if defined(_MSC_VER) && (_MSC_VER < 1300) - return getDictUpdatedEltsWithEq(ldict, rdict, equal_to()); -#else - return getDictUpdatedEltsWithEq(ldict, rdict, equal_to()); -#endif -} template Dict getDictUpdatedEltsWithEq(const Dict& ldict, const Dict& rdict, EqFunc eq) @@ -223,6 +214,16 @@ getDictUpdatedEltsWithEq(const Dict& ldict, const Dict& rdict, EqFunc eq) return result; } +template Dict +getDictUpdatedElts(const Dict& ldict, const Dict& rdict) +{ +#if defined(_MSC_VER) && (_MSC_VER < 1300) + return getDictUpdatedEltsWithEq(ldict, rdict, equal_to()); +#else + return getDictUpdatedEltsWithEq(ldict, rdict, equal_to()); +#endif +} + template Ice::StringSeq getDictRemovedElts(const Dict& ldict, const Dict& rdict) { diff --git cpp.old/src/IceGrid/ReplicaCache.cpp cpp/src/IceGrid/ReplicaCache.cpp index 53ad03e..154853d 100644 --- cpp/src/IceGrid/ReplicaCache.cpp +++ cpp.orig/src/IceGrid/ReplicaCache.cpp @@ -40,7 +40,7 @@ ReplicaCache::add(const string& name, const ReplicaSessionIPtr& session) Lock sync(*this); ReplicaEntryPtr entry; - while(entry = getImpl(name)) + while((entry = getImpl(name))) { ReplicaSessionIPtr session = entry->getSession(); if(session->isDestroyed()) diff --git cpp.old/src/IceGrid/SessionI.h cpp/src/IceGrid/SessionI.h index 3c67e20..f5c1b2e 100644 --- cpp/src/IceGrid/SessionI.h +++ cpp.orig/src/IceGrid/SessionI.h @@ -35,7 +35,7 @@ typedef IceUtil::Handle AllocatablePtr; class SessionI; typedef IceUtil::Handle SessionIPtr; -class BaseSessionI : virtual Ice::Object, public IceUtil::Mutex +class BaseSessionI : virtual public Ice::Object, public IceUtil::Mutex { public: diff --git cpp.old/src/IceSSL/Instance.cpp cpp/src/IceSSL/Instance.cpp index 5eb4c58..585620c 100644 --- cpp/src/IceSSL/Instance.cpp +++ cpp.orig/src/IceSSL/Instance.cpp @@ -38,7 +38,7 @@ using namespace std; using namespace Ice; using namespace IceSSL; -IceUtil::Shared* IceInternal::upCast(IceSSL::Instance* p) { return p; } +IceUtil::Shared* IceSSL::upCast(IceSSL::Instance* p) { return p; } namespace { diff --git cpp.old/src/IceSSL/InstanceF.h cpp/src/IceSSL/InstanceF.h index d08a3a9..b03d995 100644 --- cpp/src/IceSSL/InstanceF.h +++ cpp.orig/src/IceSSL/InstanceF.h @@ -18,13 +18,13 @@ namespace IceSSL { class Instance; +IceUtil::Shared* upCast(IceSSL::Instance*); } namespace IceInternal { -IceUtil::Shared* upCast(IceSSL::Instance*); } diff --git cpp.old/src/IceSSL/TrustManager.cpp cpp/src/IceSSL/TrustManager.cpp index 0ec6e28..c4549b9 100644 --- cpp/src/IceSSL/TrustManager.cpp +++ cpp.orig/src/IceSSL/TrustManager.cpp @@ -20,7 +20,7 @@ using namespace std; using namespace IceSSL; -IceUtil::Shared* IceInternal::upCast(IceSSL::TrustManager* p) { return p; } +IceUtil::Shared* IceSSL::upCast(IceSSL::TrustManager* p) { return p; } TrustManager::TrustManager(const Ice::CommunicatorPtr& communicator) : _communicator(communicator) diff --git cpp.old/src/IceSSL/TrustManagerF.h cpp/src/IceSSL/TrustManagerF.h index 346775c..e1af0d1 100644 --- cpp/src/IceSSL/TrustManagerF.h +++ cpp.orig/src/IceSSL/TrustManagerF.h @@ -18,13 +18,13 @@ namespace IceSSL { class TrustManager; +IceUtil::Shared* upCast(IceSSL::TrustManager*); } namespace IceInternal { -IceUtil::Shared* upCast(IceSSL::TrustManager*); } diff --git cpp.old/src/IceSSL/Util.cpp cpp/src/IceSSL/Util.cpp index fc7e19c..63f6b44 100644 --- cpp/src/IceSSL/Util.cpp +++ cpp.orig/src/IceSSL/Util.cpp @@ -175,7 +175,7 @@ convertDH(unsigned char* p, int plen, unsigned char* g, int glen) return dh; } -IceUtil::Shared* IceInternal::upCast(IceSSL::DHParams* p) { return p; } +IceUtil::Shared* IceSSL::upCast(IceSSL::DHParams* p) { return p; } IceSSL::DHParams::DHParams() : _dh512(0), _dh1024(0), _dh2048(0), _dh4096(0) diff --git cpp.old/src/IceSSL/UtilF.h cpp/src/IceSSL/UtilF.h index 4c06e1f..5bad4c8 100644 --- cpp/src/IceSSL/UtilF.h +++ cpp.orig/src/IceSSL/UtilF.h @@ -21,13 +21,13 @@ namespace IceSSL { class DHParams; +IceUtil::Shared* upCast(IceSSL::DHParams*); } namespace IceInternal { -IceUtil::Shared* upCast(IceSSL::DHParams*); } diff --git cpp.old/src/IceStorm/NodeI.cpp cpp/src/IceStorm/NodeI.cpp index 0c9511e..b9788f4 100644 --- cpp/src/IceStorm/NodeI.cpp +++ cpp.orig/src/IceStorm/NodeI.cpp @@ -18,11 +18,6 @@ using namespace std; namespace { -bool operator==(const GroupNodeInfo& info, int id) -{ - return info.id == id; -} - class CheckTask : public IceUtil::TimerTask { const NodeIPtr _node; diff --git cpp.old/src/Slice/CPlusPlusUtil.cpp cpp/src/Slice/CPlusPlusUtil.cpp index f0d6a51..0d5024d 100644 --- cpp/src/Slice/CPlusPlusUtil.cpp +++ cpp.orig/src/Slice/CPlusPlusUtil.cpp @@ -631,7 +631,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& string scope = fixKwd(cl->scope()); if(marshal) { - out << nl << stream << deref << "write(::Ice::ObjectPtr(::IceInternal::upCast(" << fixedParam + out << nl << stream << deref << "write(::Ice::ObjectPtr(" << scope << "upCast(" << fixedParam << ".get())));"; } else @@ -649,7 +649,7 @@ Slice::writeMarshalUnmarshalCode(Output& out, const TypePtr& type, const string& string scope = fixKwd(px->_class()->scope()); if(marshal) { - out << nl << stream << deref << "write(::Ice::ObjectPrx(::IceInternal::upCast(" << fixedParam + out << nl << stream << deref << "write(::Ice::ObjectPrx(::IceProxy" << scope << "upCast(" << fixedParam << ".get())));"; } else diff --git cpp.old/src/slice2cpp/Gen.cpp cpp/src/slice2cpp/Gen.cpp index dfceb00..3509ea1 100644 --- cpp/src/slice2cpp/Gen.cpp +++ cpp.orig/src/slice2cpp/Gen.cpp @@ -1944,8 +1944,10 @@ Slice::Gen::ProxyDeclVisitor::visitClassDecl(const ClassDeclPtr& p) } string name = fixKwd(p->name()); + string scoped = fixKwd(p->scoped()); H << sp << nl << "class " << name << ';'; + H << nl << _dllExport << "::IceProxy::Ice::Object* upCast(::IceProxy" << scoped << "*);"; } Slice::Gen::ProxyVisitor::ProxyVisitor(Output& h, Output& c, const string& dllExport) : @@ -3691,10 +3693,22 @@ void Slice::Gen::ObjectDeclVisitor::visitClassDecl(const ClassDeclPtr& p) { string name = fixKwd(p->name()); + string scoped = fixKwd(p->scoped()); H << sp << nl << "class " << name << ';'; H << nl << "bool operator==(const " << name << "&, const " << name << "&);"; H << nl << "bool operator<(const " << name << "&, const " << name << "&);"; + + H << sp; + + if(!p->isLocal()) + { + H << nl << _dllExport << "::Ice::Object* upCast(" << scoped << "*);"; + } + else + { + H << nl << _dllExport << "::Ice::LocalObject* upCast(" << scoped << "*);"; + } } void @@ -4922,13 +4936,13 @@ Slice::Gen::ObjectVisitor::emitGCInsertCode(const TypePtr& p, const string& pref { if((BuiltinPtr::dynamicCast(p) && BuiltinPtr::dynamicCast(p)->kind() == Builtin::KindObject) || ClassDeclPtr::dynamicCast(p)) - { - C << nl << "if(" << prefix << name << ')'; + { C << nl << "if(" << prefix << name << ')'; C << sb; ClassDeclPtr decl = ClassDeclPtr::dynamicCast(p); if(decl) { - C << nl << "::IceInternal::upCast(" << prefix << name << ".get())->__addObject(_c);"; + string scope = fixKwd(decl->scope()); + C << nl << scope << "upCast(" << prefix << name << ".get())->__addObject(_c);"; } else { @@ -4991,9 +5005,10 @@ Slice::Gen::ObjectVisitor::emitGCClearCode(const TypePtr& p, const string& prefi ClassDeclPtr decl = ClassDeclPtr::dynamicCast(p); if(decl) { - C << nl << "if(" << "::IceInternal::upCast(" << prefix << name << ".get())->__usesClasses())"; + string scope = fixKwd(decl->scope()); + C << nl << "if(" << scope << "upCast(" << prefix << name << ".get())->__usesClasses())"; C << sb; - C << nl << "::IceInternal::upCast(" << prefix << name << ".get())->__decRefUnsafe();"; + C << nl << scope << "upCast(" << prefix << name << ".get())->__decRefUnsafe();"; C << nl << prefix << name << ".__clearHandleUnsafe();"; } @@ -5629,40 +5644,30 @@ Slice::Gen::IceInternalVisitor::visitClassDecl(const ClassDeclPtr& p) { string scoped = fixKwd(p->scoped()); - H << sp; - - if(!p->isLocal()) - { - H << nl << _dllExport << "::Ice::Object* upCast(" << scoped << "*);"; - H << nl << _dllExport << "::IceProxy::Ice::Object* upCast(::IceProxy" << scoped << "*);"; - } - else - { - H << nl << _dllExport << "::Ice::LocalObject* upCast(" << scoped << "*);"; - } } bool Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p) { string scoped = fixKwd(p->scoped()); + string scope = fixKwd(p->scope()); C << sp; if(!p->isLocal()) { C << nl << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") - << "::Ice::Object* IceInternal::upCast(" << scoped << "* p) { return p; }"; + << "::Ice::Object* " << scope << "upCast(" << scoped << "* p) { return p; }"; C << nl << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") - << "::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy" << scoped + << "::IceProxy::Ice::Object* IceProxy" << scope << "upCast(::IceProxy" << scoped << "* p) { return p; }"; } else { C << nl << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") - << "::Ice::LocalObject* IceInternal::upCast(" << scoped << "* p) { return p; }"; + << "::Ice::LocalObject* " << scope << "upCast(" << scoped << "* p) { return p; }"; } return true; diff --git cpp.old/src/slice2cs/Gen.cpp cpp/src/slice2cs/Gen.cpp index 90d3136..151f2e3 100644 --- cpp/src/slice2cs/Gen.cpp +++ cpp.orig/src/slice2cs/Gen.cpp @@ -1281,7 +1281,7 @@ Slice::CsVisitor::writeConstantValue(const TypePtr& type, const SyntaxTreeBasePt { _out << value << "F"; } - else if(ep = EnumPtr::dynamicCast(type)) + else if((ep = EnumPtr::dynamicCast(type))) { string enumName = fixId(ep->scoped()); string::size_type colon = value.rfind(':'); diff --git cpp.old/src/slice2java/Gen.cpp cpp/src/slice2java/Gen.cpp index e0ac391..5dd7226 100644 --- cpp/src/slice2java/Gen.cpp +++ cpp.orig/src/slice2java/Gen.cpp @@ -1246,7 +1246,7 @@ Slice::JavaVisitor::writeConstantValue(Output& out, const TypePtr& type, const S { BuiltinPtr bp; EnumPtr ep; - if(bp = BuiltinPtr::dynamicCast(type)) + if((bp = BuiltinPtr::dynamicCast(type))) { switch(bp->kind()) { @@ -1349,7 +1349,7 @@ Slice::JavaVisitor::writeConstantValue(Output& out, const TypePtr& type, const S } } - else if(ep = EnumPtr::dynamicCast(type)) + else if((ep = EnumPtr::dynamicCast(type))) { string val = value; string::size_type pos = val.rfind(':'); diff --git cpp.old/test/Glacier2/ssl/Server.cpp cpp/test/Glacier2/ssl/Server.cpp index 4fb14f5..1b0c6a5 100644 --- cpp/test/Glacier2/ssl/Server.cpp +++ cpp.orig/test/Glacier2/ssl/Server.cpp @@ -31,9 +31,15 @@ void testContext(bool ssl, const Ice::Context& context) test(ctx["_con.type"] == "ssl"); test(ctx["_con.localPort"] == "12348"); } - test(ctx["_con.localAddress"] == "127.0.0.1"); + if (!inFreeBSDJail()) + { + test(ctx["_con.localAddress"] == "127.0.0.1"); + } test(ctx["_con.remotePort"] != ""); - test(ctx["_con.remoteAddress"] == "127.0.0.1"); + if (!inFreeBSDJail()) + { + test(ctx["_con.remoteAddress"] == "127.0.0.1"); + } } } @@ -99,7 +105,7 @@ public: } virtual void - ice_ping(const Ice::Current& current) + ice_ping(const Ice::Current& current) const { testContext(_ssl, current.ctx); } @@ -133,8 +139,11 @@ public: { testContext(true, current.ctx); - test(info.remoteHost == "127.0.0.1"); - test(info.localHost == "127.0.0.1"); + if (!inFreeBSDJail()) + { + test(info.remoteHost == "127.0.0.1"); + test(info.localHost == "127.0.0.1"); + } test(info.localPort == 12348); try diff --git cpp.old/test/Ice/custom/AllTests.cpp cpp/test/Ice/custom/AllTests.cpp index bf66fa9..9907e6b 100644 --- cpp/test/Ice/custom/AllTests.cpp +++ cpp.orig/test/Ice/custom/AllTests.cpp @@ -1384,7 +1384,8 @@ public: const ::Test::ClassStructSeq& seq, const InParamPtr& cookie) { - pair< ::Test::ClassStructPtr, ::Test::ClassStructSeq> in = getIn(in, cookie); + pair< ::Test::ClassStructPtr, ::Test::ClassStructSeq> in; + in = getIn(in, cookie); test(ret == in.first); test(cs1 == in.first); test(seq == in.second); @@ -1432,7 +1433,8 @@ public: void throwExcept1(const Ice::AsyncResultPtr& result) { - wstring in = getIn(in, InParamPtr::dynamicCast(result->getCookie())); + wstring in; + in = getIn(in, InParamPtr::dynamicCast(result->getCookie())); try { Test1::WstringClassPrx t = Test1::WstringClassPrx::uncheckedCast(result->getProxy()); @@ -1451,7 +1453,8 @@ public: void throwExcept2(const Ice::AsyncResultPtr& result) { - wstring in = getIn(in, InParamPtr::dynamicCast(result->getCookie())); + wstring in; + in = getIn(in, InParamPtr::dynamicCast(result->getCookie())); try { Test2::WstringClassPrx t = Test2::WstringClassPrx::uncheckedCast(result->getProxy()); diff --git cpp.old/test/Ice/info/AllTests.cpp cpp/test/Ice/info/AllTests.cpp index 3e9c229..7f92b7f 100644 --- cpp/test/Ice/info/AllTests.cpp +++ cpp.orig/test/Ice/info/AllTests.cpp @@ -141,9 +141,11 @@ allTests(const Ice::CommunicatorPtr& communicator) test(info->adapterName.empty()); test(info->localPort > 0); test(info->remotePort == 12010); - test(info->remoteAddress == defaultHost); - test(info->localAddress == defaultHost); - + if (!inFreeBSDJail()) + { + test(info->remoteAddress == defaultHost); + test(info->localAddress == defaultHost); + } ostringstream os; Ice::Context ctx = testIntf->getConnectionInfoAsContext(); @@ -163,8 +165,11 @@ allTests(const Ice::CommunicatorPtr& communicator) test(info->adapterName.empty()); test(info->localPort > 0); test(info->remotePort == 12010); - test(info->remoteAddress ==defaultHost); - test(info->localAddress == defaultHost); + if (!inFreeBSDJail()) + { + test(info->remoteAddress == defaultHost); + test(info->localAddress == defaultHost); + } } cout << "ok" << endl; diff --git cpp.old/test/Ice/properties/run.py cpp/test/Ice/properties/run.py index 18f78f0..955295e 100755 --- cpp/test/Ice/properties/run.py +++ cpp.orig/test/Ice/properties/run.py @@ -26,7 +26,7 @@ client = os.path.join(os.getcwd(), "client") # # Write config # -configPath = u"./config/中国_client.config" +configPath = u"./config/中国_client.config".encode("utf-8") TestUtil.createConfig(configPath, ["# Automatically generated by Ice test driver.", diff --git cpp.old/test/include/TestCommon.h cpp/test/include/TestCommon.h index 651a885..ca603d4 100644 --- cpp/test/include/TestCommon.h +++ cpp.orig/test/include/TestCommon.h @@ -17,6 +17,22 @@ #include #endif +#if defined(__FreeBSD__) +# include +# include +inline bool inFreeBSDJail() +{ + int jailed; + size_t size = sizeof(jailed); + return (sysctlbyname("security.jail.jailed", &jailed, &size, NULL, 0) != -1 || jailed); +} +#else +inline bool inFreeBSDJail() +{ + return false; +} +#endif + void inline testFailed(const char* expr, const char* file, unsigned int line) { diff --git scripts/TestUtil.py scripts/TestUtil.py index e02da06..9b5f497 100755 --- scripts/TestUtil.py +++ scripts/TestUtil.py @@ -74,6 +74,25 @@ def isDarwin(): def isLinux(): return sys.platform.startswith("linux") +def isFreeBSD(): + return sys.platform.startswith("freebsd") + +def sysctl(key): + p = subprocess.Popen("sysctl "+key, shell=1, stdout=subprocess.PIPE) + try: + result = p.communicate()[0].strip().split()[1] + except IndexError: + return 0 + if sys.version_info >= (3,): + result = str(result, sys.stdout.encoding) + try: + return int(result) + except ValueError: + return result + +def isFreeBSDJail(): + return isFreeBSD() and sysctl("security.jail.jailed") + def getCppCompiler(): compiler = "" if os.environ.get("CPP_COMPILER", "") != "": @@ -1590,7 +1609,15 @@ def runTests(start, expanded, num = 0, script = False): if isDarwin() and "nodarwin" in config: print "%s*** test not supported under Darwin%s" % (prefix, suffix) continue + + if isFreeBSD() and "nofreebsd" in config: + print "%s*** test not supported under FreeBSD%s" % (prefix, suffix) + continue + if isFreeBSDJail() and "nofreebsdjail" in config: + print "%s*** test not supported within a FreeBSD Jail%s" % (prefix, suffix) + continue + if not isWin32() and "win32only" in config: print "%s*** test only supported under Win32%s" % (prefix, suffix) continue