summaryrefslogtreecommitdiff
path: root/cpp/src/slice2cpp/Gen.cpp
diff options
context:
space:
mode:
authorMatthew Newhook <matthew@zeroc.com>2008-04-28 15:53:26 +0800
committerMatthew Newhook <matthew@zeroc.com>2008-04-28 15:53:26 +0800
commitd638e8887f77d79802443504c4c56b26f189c9f8 (patch)
tree451bccd0caa977b4f35ac1ed89345ee2d1a8a898 /cpp/src/slice2cpp/Gen.cpp
parentMerge branch 'master' of ssh://cvs.zeroc.com/home/git/ice (diff)
downloadice-d638e8887f77d79802443504c4c56b26f189c9f8.tar.bz2
ice-d638e8887f77d79802443504c4c56b26f189c9f8.tar.xz
ice-d638e8887f77d79802443504c4c56b26f189c9f8.zip
- Reverted prior bug3025 fix.
- Translator, if dll-export is used, emits code to automatically export symbols. - Removed the two steps builds from various Makefiles. - Removed any use of _API from .cpp source files. Now ICE_DECLSPEC_EXPORT is directly used. - Fixed bug with IceGrid test. Squashed commit of the following: commit 5bf039b18ac45bb781b8c8718e03d6055bb5138d Author: U-MARCH4\matthew <matthew@march4.(none)> Date: Sun Apr 27 22:43:27 2008 -0700 Removed another translator case where _API was used in .cpp files. commit 6fc3b01b340ce81299c2896fd624faacea456bdc Author: Matthew Newhook <matthew@zeroc.com> Date: Mon Apr 28 12:19:03 2008 +0800 Update UNIX Makefiles. commit 5847f6cf40624a7c9144f046feb3b8eff7002443 Author: U-MARCH4\matthew <matthew@march4.(none)> Date: Sun Apr 27 20:59:27 2008 -0700 Another fix to windows Makefile. commit d32b7f82e297c06161fb9f571e964f7178acbbe0 Author: U-MARCH4\matthew <matthew@march4.(none)> Date: Sun Apr 27 20:14:46 2008 -0700 Translator changes. Windows Makefile cleanup. commit cd8c8fa282165a5ce5dbf3976e2e420069a1ef02 Author: U-MARCH4\matthew <matthew@march4.(none)> Date: Sun Apr 27 17:01:32 2008 -0700 Revert "http://bugzilla.zeroc.com/bugzilla/show_bug.cgi?id=3025 - Bogus IceStorm Makefile" This reverts commit 187ae9e788cc97969f81b38f2e292e75fbe178f8.
Diffstat (limited to 'cpp/src/slice2cpp/Gen.cpp')
-rwxr-xr-xcpp/src/slice2cpp/Gen.cpp26
1 files changed, 21 insertions, 5 deletions
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index 152837e9799..ee86df20395 100755
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -202,6 +202,13 @@ Slice::Gen::generate(const UnitPtr& p)
writeExtraHeaders(C);
+ if(_dllExport.size())
+ {
+ C << "\n#ifndef " << _dllExport << "_EXPORTS";
+ C << "\n# define " << _dllExport << "_EXPORTS";
+ C << "\n#endif";
+ }
+
C << "\n#include <";
if(_include.size())
{
@@ -1811,7 +1818,9 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p)
// To export the virtual table
//
C << nl << "#ifdef __SUNPRO_CC";
- C << nl << "class " << _dllExport << "IceProxy" << scoped << ";";
+ C << nl << "class "
+ << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
+ << "IceProxy" << scoped << ";";
C << nl << "#endif";
}
@@ -3872,7 +3881,8 @@ Slice::Gen::ObjectVisitor::visitClassDefEnd(const ClassDefPtr& p)
{
string name = p->name();
- C << sp << nl << "void " << _dllExport;
+ C << sp << nl << "void "
+ << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ");
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);";
@@ -4557,13 +4567,19 @@ Slice::Gen::IceInternalVisitor::visitClassDefStart(const ClassDefPtr& p)
C << sp;
if(!p->isLocal())
{
- C << nl << _dllExport << "::Ice::Object* IceInternal::upCast(" << scoped << "* p) { return p; }";
- C << nl << _dllExport << "::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy" << scoped
+ C << nl
+ << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
+ << "::Ice::Object* IceInternal::upCast(" << scoped << "* p) { return p; }";
+ C << nl
+ << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
+ << "::IceProxy::Ice::Object* IceInternal::upCast(::IceProxy" << scoped
<< "* p) { return p; }";
}
else
{
- C << nl << _dllExport << "::Ice::LocalObject* IceInternal::upCast(" << scoped << "* p) { return p; }";
+ C << nl
+ << (_dllExport.empty() ? "" : "ICE_DECLSPEC_EXPORT ")
+ << "::Ice::LocalObject* IceInternal::upCast(" << scoped << "* p) { return p; }";
}
return true;