diff options
author | Bernard Normier <bernard@zeroc.com> | 2015-05-05 19:23:45 -0400 |
---|---|---|
committer | Bernard Normier <bernard@zeroc.com> | 2015-05-05 19:23:45 -0400 |
commit | a5bd24845a2720d57a66d81effc59423d723c87c (patch) | |
tree | 76faa296700b0993deb3aa97323abc904188a681 /cpp/src/IceLocatorDiscovery | |
parent | minor fixes for purify (diff) | |
download | ice-a5bd24845a2720d57a66d81effc59423d723c87c.tar.bz2 ice-a5bd24845a2720d57a66d81effc59423d723c87c.tar.xz ice-a5bd24845a2720d57a66d81effc59423d723c87c.zip |
ICE-6481 pragma comment when building static libraries
On windows with VS, pragma comment is now defined when building only when
ICE_BUILDING_<component-name> is not defined. ICE_BUILDING_<component-name>
is defined automatically when <component-name>_API_EXPORTS is defined. When building
static Ice libraries on Windows, please define
ICE_BUILDING_<component-name-being-built>.
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.
Diffstat (limited to 'cpp/src/IceLocatorDiscovery')
-rw-r--r-- | cpp/src/IceLocatorDiscovery/Makefile | 2 | ||||
-rw-r--r-- | cpp/src/IceLocatorDiscovery/Makefile.mak | 2 | ||||
-rw-r--r-- | cpp/src/IceLocatorDiscovery/PluginI.cpp | 10 |
3 files changed, 11 insertions, 3 deletions
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); |