From a5bd24845a2720d57a66d81effc59423d723c87c Mon Sep 17 00:00:00 2001 From: Bernard Normier Date: Tue, 5 May 2015 19:23:45 -0400 Subject: ICE-6481 pragma comment when building static libraries On windows with VS, pragma comment is now defined when building only when ICE_BUILDING_ is not defined. ICE_BUILDING_ is defined automatically when _API_EXPORTS is defined. When building static Ice libraries on Windows, please define ICE_BUILDING_. ICE_DECLSPEC_EXPORT and ICE_DECLSPEC_IMPORT are now defined all the time on Windows, and we define the various _API macros to /**/ when ICE_STATIC_LIBS is defined. Replaced various direct use of ICE_DECLSPEC_EXPORT/ICE_DECLSPEC_IMPORT by the correct _API macro. --- cpp/src/slice2cpp/Gen.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'cpp/src/slice2cpp/Gen.cpp') diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp index eb030600d1e..9e8d68722cb 100644 --- a/cpp/src/slice2cpp/Gen.cpp +++ b/cpp/src/slice2cpp/Gen.cpp @@ -1474,14 +1474,13 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p) // To export the virtual table // C << nl << "#ifdef __SUNPRO_CC"; - C << nl << "class " - << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") - << "IceProxy" << scoped << ";"; + C << nl << "class " << _dllExport + << "IceProxy" << scoped << ";"; C << nl << "#endif"; } C << nl - << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") + << _dllExport << "::IceProxy::Ice::Object* ::IceProxy" << scope << "upCast(::IceProxy" << scoped << "* p) { return p; }"; @@ -2789,7 +2788,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) if(!p->isLocal()) { C << sp << nl - << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") + << _dllExport << "::Ice::Object* " << scope.substr(2) << "upCast(" << scoped << "* p) { return p; }"; // @@ -2917,7 +2916,7 @@ Slice::Gen::ObjectVisitor::visitClassDefStart(const ClassDefPtr& p) else { C << sp << nl - << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ") + << _dllExport << "::Ice::LocalObject* " << scope.substr(2) << "upCast(" << scoped << "* p) { return p; }"; } @@ -3340,8 +3339,7 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p) } else { - C << sp << nl << "void " - << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT "); + C << sp << nl << "void " << _dllExport; C << nl << scope.substr(2) << "__patch(" << p->name() << "Ptr& handle, const ::Ice::ObjectPtr& v)"; C << sb; C << nl << "handle = " << scope << p->name() << "Ptr::dynamicCast(v);"; -- cgit v1.2.3