diff options
Diffstat (limited to 'cpp/src')
24 files changed, 74 insertions, 38 deletions
diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp index 0e8adefac55..f5ee4e56e69 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp +++ b/cpp/src/Glacier2CryptPermissionsVerifier/CryptPermissionsVerifierI.cpp @@ -440,13 +440,21 @@ CryptPermissionsVerifierPlugin::destroy() } +#ifndef CRYPT_PERMISSIONS_VERIFIER_API +# ifdef CRYPT_PERMISSIONS_VERIFIER_API_EXPORTS +# define CRYPT_PERMISSIONS_VERIFIER_API ICE_DECLSPEC_EXPORT +# else +# define CRYPT_PERMISSIONS_VERIFIER_API /**/ +# endif +#endif + // // Plug-in factory function. // extern "C" { -ICE_DECLSPEC_EXPORT Ice::Plugin* +CRYPT_PERMISSIONS_VERIFIER_API Ice::Plugin* createCryptPermissionsVerifier(const CommunicatorPtr& communicator, const string& name, const StringSeq& args) { if(args.size() > 0) diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/Makefile b/cpp/src/Glacier2CryptPermissionsVerifier/Makefile index f3c49c50313..5dad9fb18c0 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/Makefile +++ b/cpp/src/Glacier2CryptPermissionsVerifier/Makefile @@ -22,7 +22,7 @@ SRCS = $(OBJS:.o=.cpp) include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DCRYPT_PERMISSIONS_VERIFIER_API_EXPORTS LINKWITH := $(BZIP2_RPATH_LINK) -lIce -lIceUtil -lGlacier2 $(CRYPT_OS_LIBS) $(CXXLIBS) diff --git a/cpp/src/Glacier2CryptPermissionsVerifier/Makefile.mak b/cpp/src/Glacier2CryptPermissionsVerifier/Makefile.mak index 3828a45771e..6bb7e10f113 100644 --- a/cpp/src/Glacier2CryptPermissionsVerifier/Makefile.mak +++ b/cpp/src/Glacier2CryptPermissionsVerifier/Makefile.mak @@ -18,7 +18,7 @@ OBJS = .\CryptPermissionsVerifierI.obj !include $(top_srcdir)/config/Make.rules.mak -CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -DCRYPT_PERMISSIONS_VERIFIER_API_EXPORTS LINKWITH = $(LIBS) crypt32.lib bcrypt.lib diff --git a/cpp/src/Ice/FactoryTableInit.cpp b/cpp/src/Ice/FactoryTableInit.cpp index 0c411d866fb..9b1675e17c4 100644 --- a/cpp/src/Ice/FactoryTableInit.cpp +++ b/cpp/src/Ice/FactoryTableInit.cpp @@ -19,7 +19,7 @@ namespace IceInternal // Single global instance of the factory table for non-local // exceptions and non-abstract classes. // -ICE_DECLSPEC_EXPORT FactoryTable* factoryTable; +ICE_API FactoryTable* factoryTable; } diff --git a/cpp/src/Ice/Incoming.cpp b/cpp/src/Ice/Incoming.cpp index 0db2702359a..8b7e8a33ea4 100644 --- a/cpp/src/Ice/Incoming.cpp +++ b/cpp/src/Ice/Incoming.cpp @@ -33,7 +33,7 @@ using namespace IceInternal; namespace IceUtilInternal { -extern bool ICE_DECLSPEC_IMPORT printStackTraces; +extern bool ICE_UTIL_API printStackTraces; } diff --git a/cpp/src/Ice/Instance.cpp b/cpp/src/Ice/Instance.cpp index 59d2287ac1f..f1c18496a1c 100644 --- a/cpp/src/Ice/Instance.cpp +++ b/cpp/src/Ice/Instance.cpp @@ -74,8 +74,8 @@ using namespace IceInternal; namespace IceUtilInternal { -extern bool ICE_DECLSPEC_IMPORT nullHandleAbort; -extern bool ICE_DECLSPEC_IMPORT printStackTraces; +extern bool ICE_UTIL_API nullHandleAbort; +extern bool ICE_UTIL_API printStackTraces; }; diff --git a/cpp/src/Ice/LoggerUtil.cpp b/cpp/src/Ice/LoggerUtil.cpp index a28016cc47b..71316293ba6 100644 --- a/cpp/src/Ice/LoggerUtil.cpp +++ b/cpp/src/Ice/LoggerUtil.cpp @@ -19,7 +19,7 @@ using namespace std; namespace IceUtilInternal { -extern bool ICE_DECLSPEC_IMPORT printStackTraces; +extern bool ICE_UTIL_API printStackTraces; } diff --git a/cpp/src/Ice/ServantManager.cpp b/cpp/src/Ice/ServantManager.cpp index e07e78dbbc9..99b1a862176 100644 --- a/cpp/src/Ice/ServantManager.cpp +++ b/cpp/src/Ice/ServantManager.cpp @@ -18,7 +18,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -ICE_DECLSPEC_EXPORT IceUtil::Shared* IceInternal::upCast(ServantManager* p) { return p; } +ICE_API IceUtil::Shared* IceInternal::upCast(ServantManager* p) { return p; } void IceInternal::ServantManager::addServant(const ObjectPtr& object, const Identity& ident, const string& facet) diff --git a/cpp/src/Ice/ThreadPool.cpp b/cpp/src/Ice/ThreadPool.cpp index 6cfe2d7b09c..b2e7883c325 100644 --- a/cpp/src/Ice/ThreadPool.cpp +++ b/cpp/src/Ice/ThreadPool.cpp @@ -28,7 +28,7 @@ using namespace Ice; using namespace Ice::Instrumentation; using namespace IceInternal; -ICE_DECLSPEC_EXPORT IceUtil::Shared* IceInternal::upCast(ThreadPool* p) { return p; } +ICE_API IceUtil::Shared* IceInternal::upCast(ThreadPool* p) { return p; } namespace { diff --git a/cpp/src/Ice/TraceLevels.cpp b/cpp/src/Ice/TraceLevels.cpp index 7dbc991a33a..faef767c32c 100644 --- a/cpp/src/Ice/TraceLevels.cpp +++ b/cpp/src/Ice/TraceLevels.cpp @@ -14,7 +14,7 @@ using namespace std; using namespace Ice; using namespace IceInternal; -ICE_DECLSPEC_EXPORT IceUtil::Shared* IceInternal::upCast(TraceLevels* p) { return p; } +ICE_API IceUtil::Shared* IceInternal::upCast(TraceLevels* p) { return p; } IceInternal::TraceLevels::TraceLevels(const PropertiesPtr& properties) : network(0), diff --git a/cpp/src/IceDiscovery/Makefile b/cpp/src/IceDiscovery/Makefile index 356ea66e20e..5b462737114 100644 --- a/cpp/src/IceDiscovery/Makefile +++ b/cpp/src/IceDiscovery/Makefile @@ -27,7 +27,7 @@ SDIR = $(slicedir)/IceDiscovery include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DICE_DISCOVERY_API_EXPORTS SLICE2CPPFLAGS := --ice --include-dir IceDiscovery $(SLICE2CPPFLAGS) LINKWITH := -lIce -lIceUtil $(CXXLIBS) diff --git a/cpp/src/IceDiscovery/Makefile.mak b/cpp/src/IceDiscovery/Makefile.mak index 3c0a9a6a28b..168a95fda7e 100644 --- a/cpp/src/IceDiscovery/Makefile.mak +++ b/cpp/src/IceDiscovery/Makefile.mak @@ -24,7 +24,7 @@ OBJS = .\LocatorI.obj \ !include $(top_srcdir)/config/Make.rules.mak -CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -DICE_DISCOVERY_API_EXPORTS SLICE2CPPFLAGS = --ice --include-dir IceDiscovery $(SLICE2CPPFLAGS) LINKWITH = $(LIBS) diff --git a/cpp/src/IceDiscovery/PluginI.cpp b/cpp/src/IceDiscovery/PluginI.cpp index fd4d6dbdf03..387fffd21fa 100644 --- a/cpp/src/IceDiscovery/PluginI.cpp +++ b/cpp/src/IceDiscovery/PluginI.cpp @@ -17,13 +17,21 @@ using namespace std; using namespace IceDiscovery; +#ifndef ICE_DISCOVERY_API +# ifdef ICE_DISCOVERY_API_EXPORTS +# define ICE_DISCOVERY_API ICE_DECLSPEC_EXPORT +# else +# define ICE_DISCOVERY_API /**/ +# endif +#endif + // // Plugin factory function. // extern "C" { -ICE_DECLSPEC_EXPORT Ice::Plugin* +ICE_DISCOVERY_API Ice::Plugin* createIceDiscovery(const Ice::CommunicatorPtr& communicator, const string&, const Ice::StringSeq&) { return new PluginI(communicator); diff --git a/cpp/src/IceLocatorDiscovery/Makefile b/cpp/src/IceLocatorDiscovery/Makefile index 0e7cc99ce87..dedc6856ba0 100644 --- a/cpp/src/IceLocatorDiscovery/Makefile +++ b/cpp/src/IceLocatorDiscovery/Makefile @@ -22,7 +22,7 @@ OBJS = PluginI.o \ include $(top_srcdir)/config/Make.rules -CPPFLAGS := -I.. $(CPPFLAGS) +CPPFLAGS := -I.. $(CPPFLAGS) -DICE_LOCATOR_DISCOVERY_API_EXPORTS SLICE2CPPFLAGS := --ice --include-dir IceLocatorDiscovery $(SLICE2CPPFLAGS) LINKWITH := -lIce -lIceUtil $(CXXLIBS) diff --git a/cpp/src/IceLocatorDiscovery/Makefile.mak b/cpp/src/IceLocatorDiscovery/Makefile.mak index 3e9caa3e5d2..226cdf08ace 100644 --- a/cpp/src/IceLocatorDiscovery/Makefile.mak +++ b/cpp/src/IceLocatorDiscovery/Makefile.mak @@ -22,7 +22,7 @@ OBJS = .\PluginI.obj \ !include $(top_srcdir)/config/Make.rules.mak -CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN +CPPFLAGS = -I.. $(CPPFLAGS) -DWIN32_LEAN_AND_MEAN -DICE_LOCATOR_DISCOVERY_API_EXPORTS SLICE2CPPFLAGS = --ice --include-dir IceLocatorDiscovery $(SLICE2CPPFLAGS) LINKWITH = $(LIBS) diff --git a/cpp/src/IceLocatorDiscovery/PluginI.cpp b/cpp/src/IceLocatorDiscovery/PluginI.cpp index 7e391460de5..fb79d4b8529 100644 --- a/cpp/src/IceLocatorDiscovery/PluginI.cpp +++ b/cpp/src/IceLocatorDiscovery/PluginI.cpp @@ -16,13 +16,21 @@ using namespace std; using namespace IceLocatorDiscovery; +#ifndef ICE_LOCATOR_DISCOVERY_API +# ifdef ICE_LOCATOR_DISCOVERY_API_EXPORTS +# define ICE_LOCATOR_DISCOVERY_API ICE_DECLSPEC_EXPORT +# else +# define ICE_LOCATOR_DISCOVERY_API /**/ +# endif +#endif + // // Plugin factory function. // extern "C" { -ICE_DECLSPEC_EXPORT Ice::Plugin* +ICE_LOCATOR_DISCOVERY_API Ice::Plugin* createIceLocatorDiscovery(const Ice::CommunicatorPtr& communicator, const string&, const Ice::StringSeq&) { return new PluginI(communicator); diff --git a/cpp/src/IceSSL/PluginI.cpp b/cpp/src/IceSSL/PluginI.cpp index 6c9183cca5c..44b5bcecad3 100644 --- a/cpp/src/IceSSL/PluginI.cpp +++ b/cpp/src/IceSSL/PluginI.cpp @@ -26,7 +26,7 @@ using namespace IceSSL; extern "C" { -ICE_DECLSPEC_EXPORT Ice::Plugin* +ICE_SSL_API Ice::Plugin* createIceSSL(const CommunicatorPtr& communicator, const string& /*name*/, const StringSeq& /*args*/) { return new PluginI(communicator); diff --git a/cpp/src/IceStorm/Service.cpp b/cpp/src/IceStorm/Service.cpp index ea23ea77375..b6e98a87c05 100644 --- a/cpp/src/IceStorm/Service.cpp +++ b/cpp/src/IceStorm/Service.cpp @@ -95,7 +95,7 @@ private: extern "C" { -ICE_DECLSPEC_EXPORT ::IceBox::Service* +ICE_STORM_SERVICE_API ::IceBox::Service* createIceStorm(CommunicatorPtr communicator) { return new ServiceI; diff --git a/cpp/src/IceStorm/Service.h b/cpp/src/IceStorm/Service.h index 486844ea229..212b38a9104 100644 --- a/cpp/src/IceStorm/Service.h +++ b/cpp/src/IceStorm/Service.h @@ -13,14 +13,17 @@ #include <IceBox/IceBox.h> #include <IceStorm/IceStorm.h> -#ifdef _MSC_VER // // Automatically link with IceStormService[D].lib // -# if defined(ICE_STATIC_LIBS) -# pragma comment(lib, "IceStormService.lib") -# elif !defined(ICE_STORM_SERVICE_API_EXPORTS) -# if defined(_DEBUG) + +#if !defined(ICE_BUILDING_ICE_STORM_SERVICE) && defined(ICE_STORM_SERVICE_API_EXPORTS) +# define ICE_BUILDING_ICE_STORM_SERVICE +#endif + +#ifdef _MSC_VER +# if !defined(ICE_BUILDING_ICE_STORM_SERVICE) +# if defined(_DEBUG) && !defined(ICE_OS_WINRT) # pragma comment(lib, "IceStormServiceD.lib") # else # pragma comment(lib, "IceStormService.lib") @@ -31,6 +34,8 @@ #ifndef ICE_STORM_SERVICE_API # ifdef ICE_STORM_SERVICE_API_EXPORTS # define ICE_STORM_SERVICE_API ICE_DECLSPEC_EXPORT +# elif defined(ICE_STATIC_LIBS) +# define ICE_STORM_SERVICE_API /**/ # else # define ICE_STORM_SERVICE_API ICE_DECLSPEC_IMPORT # endif diff --git a/cpp/src/IceUtil/Exception.cpp b/cpp/src/IceUtil/Exception.cpp index d21946f8195..947815467d6 100644 --- a/cpp/src/IceUtil/Exception.cpp +++ b/cpp/src/IceUtil/Exception.cpp @@ -54,8 +54,8 @@ using namespace std; namespace IceUtilInternal { -bool ICE_DECLSPEC_EXPORT printStackTraces = false; -bool ICE_DECLSPEC_EXPORT nullHandleAbort = false; +bool ICE_UTIL_API printStackTraces = false; +bool ICE_UTIL_API nullHandleAbort = false; } diff --git a/cpp/src/IceXML/Parser.h b/cpp/src/IceXML/Parser.h index c8f1f4a8bbb..f5de9291968 100644 --- a/cpp/src/IceXML/Parser.h +++ b/cpp/src/IceXML/Parser.h @@ -20,6 +20,8 @@ #ifndef ICE_XML_API # ifdef ICE_XML_API_EXPORTS # define ICE_XML_API ICE_DECLSPEC_EXPORT +# elif defined(ICE_STATIC_LIBS) +# define ICE_XML_API /**/ # else # define ICE_XML_API ICE_DECLSPEC_IMPORT # endif @@ -28,11 +30,14 @@ // // Automatically link IceXML[D].lib with Visual C++ // + +#if !defined(ICE_BUILDING_ICE_XML) && defined(ICE_XML_API_EXPORTS) +# define ICE_BUILDING_ICE_XML +#endif + #ifdef _MSC_VER -# if defined(ICE_STATIC_LIBS) -# pragma comment(lib, "IceXML.lib") -# elif !defined(ICE_XML_API_EXPORTS) -# if defined(_DEBUG) +# if !defined(ICE_BUILDING_ICE_XML) +# if defined(_DEBUG) && !defined(ICE_OS_WINRT) # pragma comment(lib, "IceXMLD.lib") # else # pragma comment(lib, "IceXML.lib") diff --git a/cpp/src/Slice/CPlusPlusUtil.cpp b/cpp/src/Slice/CPlusPlusUtil.cpp index 95b34a2ec66..e50b4908eab 100644 --- a/cpp/src/Slice/CPlusPlusUtil.cpp +++ b/cpp/src/Slice/CPlusPlusUtil.cpp @@ -441,6 +441,8 @@ Slice::printDllExportStuff(Output& out, const string& dllExport) out << "\n#ifndef " << dllExport; out << "\n# ifdef " << dllExport << "_EXPORTS"; out << "\n# define " << dllExport << " ICE_DECLSPEC_EXPORT"; + out << "\n# elif defined(ICE_STATIC_LIBS)"; + out << "\n# define " << dllExport << " /**/"; out << "\n# else"; out << "\n# define " << dllExport << " ICE_DECLSPEC_IMPORT"; out << "\n# endif"; 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);"; diff --git a/cpp/src/slice2objc/Gen.cpp b/cpp/src/slice2objc/Gen.cpp index a8c6b825ae5..36cd2c990c2 100644 --- a/cpp/src/slice2objc/Gen.cpp +++ b/cpp/src/slice2objc/Gen.cpp @@ -759,6 +759,8 @@ Slice::Gen::generate(const UnitPtr& p) _H << nl << "#ifndef " << _dllExport; _H << nl << "# ifdef " << _dllExport << "_EXPORTS"; _H << nl << "# define " << _dllExport << " ICE_DECLSPEC_EXPORT"; + _H << nl << "# elif defined(ICE_STATIC_LIBS)"; + _H << nl << "# define " << _dllExport << " /**/"; _H << nl << "# else"; _H << nl << "# define " << _dllExport << " ICE_DECLSPEC_IMPORT"; _H << nl << "# endif"; |