[ice/f17] fix issue where upCast is used before being declared with gcc 4.7

Tom Callaway spot at fedoraproject.org
Fri Mar 16 20:28:56 UTC 2012


commit dd13d5537030072a3529c9421d99ee8a5f63517a
Author: Tom Callaway <spot at fedoraproject.org>
Date:   Fri Mar 16 16:28:53 2012 -0400

    fix issue where upCast is used before being declared with gcc 4.7

 ice-3.4.2-declfix.patch |  495 +++++++++++++++++++++++++++++++++++++++++++++++
 ice.spec                |   14 ++-
 2 files changed, 507 insertions(+), 2 deletions(-)
---
diff --git a/ice-3.4.2-declfix.patch b/ice-3.4.2-declfix.patch
new file mode 100644
index 0000000..292ba8a
--- /dev/null
+++ b/ice-3.4.2-declfix.patch
@@ -0,0 +1,495 @@
+diff -up Ice-3.4.2/cpp/include/Ice/ConnectionIF.h.declfix Ice-3.4.2/cpp/include/Ice/ConnectionIF.h
+--- Ice-3.4.2/cpp/include/Ice/ConnectionIF.h.declfix	2012-03-16 14:21:17.477660480 -0400
++++ Ice-3.4.2/cpp/include/Ice/ConnectionIF.h	2012-03-16 14:21:41.875689784 -0400
+@@ -17,14 +17,13 @@ namespace Ice
+ {
+ 
+ class ConnectionI;
++ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*);
+ 
+ }
+ 
+ namespace IceInternal
+ {
+ 
+-ICE_API Ice::LocalObject* upCast(Ice::ConnectionI*);
+-
+ enum AsyncStatus
+ {
+     AsyncStatusQueued = 0,
+diff -up Ice-3.4.2/cpp/include/Ice/IncomingAsyncF.h.declfix Ice-3.4.2/cpp/include/Ice/IncomingAsyncF.h
+--- Ice-3.4.2/cpp/include/Ice/IncomingAsyncF.h.declfix	2012-03-16 14:22:05.595740873 -0400
++++ Ice-3.4.2/cpp/include/Ice/IncomingAsyncF.h	2012-03-16 14:22:43.527193349 -0400
+@@ -29,11 +29,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 -up Ice-3.4.2/cpp/include/Ice/LocalObjectF.h.declfix Ice-3.4.2/cpp/include/Ice/LocalObjectF.h
+--- Ice-3.4.2/cpp/include/Ice/LocalObjectF.h.declfix	2012-03-16 14:22:52.846810492 -0400
++++ Ice-3.4.2/cpp/include/Ice/LocalObjectF.h	2012-03-16 14:23:10.132099108 -0400
+@@ -19,11 +19,6 @@ namespace Ice
+ 
+ class LocalObject;
+ 
+-}
+-
+-namespace IceInternal
+-{
+-
+ ICE_API IceUtil::Shared* upCast(::Ice::LocalObject*);
+ 
+ }
+diff -up Ice-3.4.2/cpp/include/Ice/ObjectF.h.declfix Ice-3.4.2/cpp/include/Ice/ObjectF.h
+--- Ice-3.4.2/cpp/include/Ice/ObjectF.h.declfix	2012-03-16 14:23:25.717456731 -0400
++++ Ice-3.4.2/cpp/include/Ice/ObjectF.h	2012-03-16 14:23:47.206660333 -0400
+@@ -18,18 +18,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 -up Ice-3.4.2/cpp/include/Ice/OutgoingAsyncF.h.declfix Ice-3.4.2/cpp/include/Ice/OutgoingAsyncF.h
+--- Ice-3.4.2/cpp/include/Ice/OutgoingAsyncF.h.declfix	2012-03-16 14:23:56.681325301 -0400
++++ Ice-3.4.2/cpp/include/Ice/OutgoingAsyncF.h	2012-03-16 14:24:30.889027589 -0400
+@@ -19,14 +19,13 @@ namespace Ice
+ 
+ class AsyncResult;
+ typedef IceInternal::Handle<AsyncResult> 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*);
+ typedef IceInternal::Handle<OutgoingAsync> OutgoingAsyncPtr;
+diff -up Ice-3.4.2/cpp/include/Ice/ProxyF.h.declfix Ice-3.4.2/cpp/include/Ice/ProxyF.h
+--- Ice-3.4.2/cpp/include/Ice/ProxyF.h.declfix	2012-03-16 14:25:28.416694680 -0400
++++ Ice-3.4.2/cpp/include/Ice/ProxyF.h	2012-03-16 14:27:41.670625885 -0400
+@@ -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;
++}
+ 
+ }
+ 
+@@ -46,6 +56,11 @@ namespace Ice
+ {
+ 
+ class Object;
++inline ::IceDelegateM::Ice::Object*
++upCast(::IceDelegateM::Ice::Object* o)
++{
++    return o;
++}
+ 
+ }
+ 
+@@ -58,36 +73,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 -up Ice-3.4.2/cpp/include/Ice/Proxy.h.declfix Ice-3.4.2/cpp/include/Ice/Proxy.h
+--- Ice-3.4.2/cpp/include/Ice/Proxy.h.declfix	2012-03-16 14:24:44.730476801 -0400
++++ Ice-3.4.2/cpp/include/Ice/Proxy.h	2012-03-16 14:25:23.663888545 -0400
+@@ -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,9 +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;
+ 
+ }
+diff -up Ice-3.4.2/cpp/include/Ice/StreamF.h.declfix Ice-3.4.2/cpp/include/Ice/StreamF.h
+--- Ice-3.4.2/cpp/include/Ice/StreamF.h.declfix	2012-03-16 14:28:07.894962957 -0400
++++ Ice-3.4.2/cpp/include/Ice/StreamF.h	2012-03-16 14:30:04.930370122 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/Ice/ConnectionI.cpp.declfix Ice-3.4.2/cpp/src/Ice/ConnectionI.cpp
+--- Ice-3.4.2/cpp/src/Ice/ConnectionI.cpp.declfix	2012-03-16 14:30:38.292393177 -0400
++++ Ice-3.4.2/cpp/src/Ice/ConnectionI.cpp	2012-03-16 14:31:00.960121020 -0400
+@@ -32,7 +32,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 -up Ice-3.4.2/cpp/src/Ice/IncomingAsync.cpp.declfix Ice-3.4.2/cpp/src/Ice/IncomingAsync.cpp
+--- Ice-3.4.2/cpp/src/Ice/IncomingAsync.cpp.declfix	2012-03-16 14:31:12.754117072 -0400
++++ Ice-3.4.2/cpp/src/Ice/IncomingAsync.cpp	2012-03-16 14:31:37.449563662 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/Ice/LocalObject.cpp.declfix Ice-3.4.2/cpp/src/Ice/LocalObject.cpp
+--- Ice-3.4.2/cpp/src/Ice/LocalObject.cpp.declfix	2012-03-16 14:35:08.838943047 -0400
++++ Ice-3.4.2/cpp/src/Ice/LocalObject.cpp	2012-03-16 14:35:18.768549539 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/Ice/Object.cpp.declfix Ice-3.4.2/cpp/src/Ice/Object.cpp
+--- Ice-3.4.2/cpp/src/Ice/Object.cpp.declfix	2012-03-16 14:35:28.525122781 -0400
++++ Ice-3.4.2/cpp/src/Ice/Object.cpp	2012-03-16 14:35:42.157345265 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/Ice/OutgoingAsync.cpp.declfix Ice-3.4.2/cpp/src/Ice/OutgoingAsync.cpp
+--- Ice-3.4.2/cpp/src/Ice/OutgoingAsync.cpp.declfix	2012-03-16 14:35:53.009819098 -0400
++++ Ice-3.4.2/cpp/src/Ice/OutgoingAsync.cpp	2012-03-16 14:36:06.086233644 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/IceSSL/Instance.cpp.declfix Ice-3.4.2/cpp/src/IceSSL/Instance.cpp
+--- Ice-3.4.2/cpp/src/IceSSL/Instance.cpp.declfix	2012-03-16 14:37:35.881092488 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/Instance.cpp	2012-03-16 14:37:55.247369795 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/IceSSL/InstanceF.h.declfix Ice-3.4.2/cpp/src/IceSSL/InstanceF.h
+--- Ice-3.4.2/cpp/src/IceSSL/InstanceF.h.declfix	2012-03-16 14:38:06.115947040 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/InstanceF.h	2012-03-16 14:38:26.580126033 -0400
+@@ -18,14 +18,13 @@ namespace IceSSL
+ {
+ 
+ class Instance;
++IceUtil::Shared* upCast(IceSSL::Instance*);
+ 
+ }
+ 
+ namespace IceInternal
+ {
+ 
+-IceUtil::Shared* upCast(IceSSL::Instance*);
+-
+ }
+ 
+ namespace IceSSL
+diff -up Ice-3.4.2/cpp/src/IceSSL/TrustManager.cpp.declfix Ice-3.4.2/cpp/src/IceSSL/TrustManager.cpp
+--- Ice-3.4.2/cpp/src/IceSSL/TrustManager.cpp.declfix	2012-03-16 14:38:39.605592792 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/TrustManager.cpp	2012-03-16 14:38:50.523208057 -0400
+@@ -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 -up Ice-3.4.2/cpp/src/IceSSL/TrustManagerF.h.declfix Ice-3.4.2/cpp/src/IceSSL/TrustManagerF.h
+--- Ice-3.4.2/cpp/src/IceSSL/TrustManagerF.h.declfix	2012-03-16 14:39:06.720622883 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/TrustManagerF.h	2012-03-16 14:39:22.951001784 -0400
+@@ -18,14 +18,13 @@ namespace IceSSL
+ {
+ 
+ class TrustManager;
++IceUtil::Shared* upCast(IceSSL::TrustManager*);
+ 
+ }
+ 
+ namespace IceInternal
+ {
+ 
+-IceUtil::Shared* upCast(IceSSL::TrustManager*);
+-
+ }
+ 
+ namespace IceSSL
+diff -up Ice-3.4.2/cpp/src/IceSSL/Util.cpp.declfix Ice-3.4.2/cpp/src/IceSSL/Util.cpp
+--- Ice-3.4.2/cpp/src/IceSSL/Util.cpp.declfix	2012-03-16 14:39:36.804454836 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/Util.cpp	2012-03-16 14:39:50.285911544 -0400
+@@ -175,7 +175,7 @@ convertDH(unsigned char* p, int plen, un
+     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 -up Ice-3.4.2/cpp/src/IceSSL/UtilF.h.declfix Ice-3.4.2/cpp/src/IceSSL/UtilF.h
+--- Ice-3.4.2/cpp/src/IceSSL/UtilF.h.declfix	2012-03-16 14:39:56.455659936 -0400
++++ Ice-3.4.2/cpp/src/IceSSL/UtilF.h	2012-03-16 14:40:34.272114829 -0400
+@@ -21,14 +21,13 @@ namespace IceSSL
+ {
+ 
+ class DHParams;
++IceUtil::Shared* upCast(IceSSL::DHParams*);
+ 
+ }
+ 
+ namespace IceInternal
+ {
+ 
+-IceUtil::Shared* upCast(IceSSL::DHParams*);
+-
+ }
+ 
+ namespace IceSSL
+diff -up Ice-3.4.2/cpp/src/Ice/Stream.cpp.declfix Ice-3.4.2/cpp/src/Ice/Stream.cpp
+--- Ice-3.4.2/cpp/src/Ice/Stream.cpp.declfix	2012-03-16 14:36:32.591093751 -0400
++++ Ice-3.4.2/cpp/src/Ice/Stream.cpp	2012-03-16 14:36:57.705775115 -0400
+@@ -13,5 +13,5 @@ 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; }
+diff -up Ice-3.4.2/cpp/src/slice2cpp/Gen.cpp.declfix Ice-3.4.2/cpp/src/slice2cpp/Gen.cpp
+--- Ice-3.4.2/cpp/src/slice2cpp/Gen.cpp.declfix	2012-03-16 14:42:21.484875354 -0400
++++ Ice-3.4.2/cpp/src/slice2cpp/Gen.cpp	2012-03-16 14:47:10.498627160 -0400
+@@ -1944,8 +1944,10 @@ Slice::Gen::ProxyDeclVisitor::visitClass
+     }
+ 
+     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
+@@ -4928,7 +4942,8 @@ Slice::Gen::ObjectVisitor::emitGCInsertC
+         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 +5006,10 @@ Slice::Gen::ObjectVisitor::emitGCClearCo
+         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();";
+ 
+         }
+@@ -5628,41 +5644,30 @@ void
+ 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 -up Ice-3.4.2/cpp/src/Slice/CPlusPlusUtil.cpp.declfix Ice-3.4.2/cpp/src/Slice/CPlusPlusUtil.cpp
+--- Ice-3.4.2/cpp/src/Slice/CPlusPlusUtil.cpp.declfix	2012-03-16 14:41:06.687787097 -0400
++++ Ice-3.4.2/cpp/src/Slice/CPlusPlusUtil.cpp	2012-03-16 14:42:03.792510461 -0400
+@@ -631,7 +631,7 @@ Slice::writeMarshalUnmarshalCode(Output&
+         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&
+         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 a/ice.spec b/ice.spec
index 7a3bbd9..a2361c1 100644
--- a/ice.spec
+++ b/ice.spec
@@ -7,7 +7,7 @@
 
 Name:           ice
 Version:        3.4.2
-Release:        10%{?dist}
+Release:        11%{?dist}
 Summary:        ZeroC Object-Oriented middleware
 
 Group:          System Environment/Libraries
@@ -44,6 +44,12 @@ Patch5:         ice-3.4.2-java7.patch
 # fix php 5.4 compilation (from upstream)
 Patch6:         ice-3.4.2-php54.patch
 Patch7:         ice-3.4.2-gcc47.patch
+# fix this issue, seen in mumble:
+# error: 'upCast' was not declared in this scope, and no declarations 
+# were found by argument-dependent lookup at the point of instantiation 
+# [-fpermissive]
+# See: http://www.zeroc.com/forums/patches/5647-patch-compiling-ice-clang-gcc4-7-a.html
+Patch8:         ice-3.4.2-declfix.patch
 BuildRoot:      %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
 
 # Ice doesn't officially support ppc64 at all
@@ -214,6 +220,7 @@ Tools for developing Ice applications in PHP.
 %patch5 -p1
 %patch6 -p1 -b .php54
 %patch7 -p1
+%patch8 -p1 -b .declfix
 %{__tar} xf %{SOURCE1}
 rm -f ice-3.4.2-man-pages/slice2docbook.1
 
@@ -597,9 +604,12 @@ fi
 
 
 %changelog
+* Fri Mar 16 2012 Tom Callaway <spot at fedoraproject.org> 3.4.2-11
+- fix issue where upCast is used before being declared with gcc 4.7
+
 * Tue Feb 28 2012 Fedora Release Engineering <rel-eng at lists.fedoraproject.org> - 3.4.2-10
 - Rebuilt for c++ ABI breakage
-
+ 
 * Fri Feb 17 2012 Deepak Bhole <dbhole at redhat.com> 3.4.2-9
 - Resolves rhbz#791372
 - Patch from Omair Majid <omajid at redhat.com> to remove explicit Java 6 req.


More information about the scm-commits mailing list