summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--cpp/config/Make.rules.Darwin2
-rw-r--r--cpp/config/Make.rules.Linux4
-rw-r--r--cpp/include/Ice/Format.h2
-rw-r--r--cpp/include/IceUtil/Config.h3
-rw-r--r--cpp/include/Slice/Parser.h6
-rw-r--r--cpp/src/Ice/Network.h2
-rw-r--r--cpp/src/slice2cpp/Gen.cpp22
7 files changed, 21 insertions, 20 deletions
diff --git a/cpp/config/Make.rules.Darwin b/cpp/config/Make.rules.Darwin
index d3188700ec0..7f6cc37e2e4 100644
--- a/cpp/config/Make.rules.Darwin
+++ b/cpp/config/Make.rules.Darwin
@@ -16,7 +16,7 @@ OSX_TARGET_MIN_SDK_VERSION = 10.8
CXX = xcrun clang++
CPPFLAGS += -pthread
-CXXFLAGS += -Wall -Werror -mmacosx-version-min=$(OSX_TARGET_MIN_SDK_VERSION)
+CXXFLAGS += -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -mmacosx-version-min=$(OSX_TARGET_MIN_SDK_VERSION)
ifeq ($(OPTIMIZE),yes)
#
diff --git a/cpp/config/Make.rules.Linux b/cpp/config/Make.rules.Linux
index 812f9425954..8705a3aaa44 100644
--- a/cpp/config/Make.rules.Linux
+++ b/cpp/config/Make.rules.Linux
@@ -40,7 +40,7 @@ ifeq ($(CXX),g++)
ifeq ($(CPP11), yes)
CPPFLAGS += -std=c++0x
endif
-
+
ifeq ($(MACHINE),sparc64)
#
# We are an ultra, at least, and so have the atomic instructions
@@ -79,7 +79,7 @@ ifeq ($(CXX),g++)
endif
endif
- CXXFLAGS = $(CXXARCHFLAGS) -Wall -Werror -pthread
+ CXXFLAGS = $(CXXARCHFLAGS) -fvisibility=hidden -fvisibility-inlines-hidden -Wall -Werror -pthread
ifneq ($(GENPIC),no)
CXXFLAGS += -fPIC
diff --git a/cpp/include/Ice/Format.h b/cpp/include/Ice/Format.h
index 81c9f525a7b..80f025f216d 100644
--- a/cpp/include/Ice/Format.h
+++ b/cpp/include/Ice/Format.h
@@ -18,7 +18,7 @@ namespace Ice
//
// This enumeration describes the possible formats for classes and exceptions.
//
-ICE_API enum FormatType
+enum ICE_API FormatType
{
//
// Indicates that no preference was specified.
diff --git a/cpp/include/IceUtil/Config.h b/cpp/include/IceUtil/Config.h
index 72e29b46f91..1332b20c9ea 100644
--- a/cpp/include/IceUtil/Config.h
+++ b/cpp/include/IceUtil/Config.h
@@ -109,6 +109,9 @@
# define ICE_DECLSPEC_EXPORT __declspec(dllexport)
# define ICE_DECLSPEC_IMPORT __declspec(dllimport)
# define ICE_HAS_DECLSPEC_IMPORT_EXPORT
+#elif defined(__GNUC__)
+# define ICE_DECLSPEC_EXPORT __attribute__ ((visibility ("default")))
+# define ICE_DECLSPEC_IMPORT __attribute__ ((visibility ("default")))
#elif defined(__SUNPRO_CC)
# define ICE_DECLSPEC_EXPORT __global
# define ICE_DECLSPEC_IMPORT /**/
diff --git a/cpp/include/Slice/Parser.h b/cpp/include/Slice/Parser.h
index a057c12a2d5..f4a6da1498a 100644
--- a/cpp/include/Slice/Parser.h
+++ b/cpp/include/Slice/Parser.h
@@ -57,13 +57,13 @@ const IceUtil::Int64 Int16Min = -Int16Max - 1;
const IceUtil::Int64 ByteMax = 0xff;
const IceUtil::Int64 ByteMin = 0x00;
-SLICE_API enum FeatureProfile
+enum SLICE_API FeatureProfile
{
Ice,
IceE
};
-SLICE_API enum NodeType
+enum SLICE_API NodeType
{
Dummy,
Real
@@ -72,7 +72,7 @@ SLICE_API enum NodeType
//
// Format preference for classes and exceptions.
//
-SLICE_API enum FormatType
+enum SLICE_API FormatType
{
DefaultFormat, // No preference was specified.
CompactFormat, // Minimal format.
diff --git a/cpp/src/Ice/Network.h b/cpp/src/Ice/Network.h
index b967074a229..7576f48ca30 100644
--- a/cpp/src/Ice/Network.h
+++ b/cpp/src/Ice/Network.h
@@ -195,8 +195,6 @@ protected:
};
typedef IceUtil::Handle<NativeInfo> NativeInfoPtr;
-class ICE_API Buffer;
-
class ICE_API NetworkProxy : virtual public IceUtil::Shared
{
public:
diff --git a/cpp/src/slice2cpp/Gen.cpp b/cpp/src/slice2cpp/Gen.cpp
index babb4fcceb3..314b6db8e82 100644
--- a/cpp/src/slice2cpp/Gen.cpp
+++ b/cpp/src/slice2cpp/Gen.cpp
@@ -1476,7 +1476,7 @@ Slice::Gen::ProxyVisitor::visitClassDefStart(const ClassDefPtr& p)
string scoped = fixKwd(p->scoped());
ClassList bases = p->bases();
- H << sp << nl << "class " << name << " : ";
+ H << sp << nl << "class " << _dllExport << " " << name << " : ";
if(bases.empty())
{
H << "virtual public ::IceProxy::Ice::Object";
@@ -1659,14 +1659,14 @@ Slice::Gen::ProxyVisitor::visitClassDefEnd(const ClassDefPtr& p)
H << nl << "return dynamic_cast<" << name << "*>(::IceProxy::Ice::Object::ice_encodingVersion(__v).get());";
H << eb;
- H << nl << nl << _dllExport << "static const ::std::string& ice_staticId();";
+ H << nl << nl << "static const ::std::string& ice_staticId();";
H.dec();
H << sp << nl << "private: ";
H.inc();
- H << sp << nl << _dllExport << "virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM();";
- H << nl << _dllExport << "virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD();";
- H << nl << _dllExport << "virtual ::IceProxy::Ice::Object* __newInstance() const;";
+ H << sp << nl << "virtual ::IceInternal::Handle< ::IceDelegateM::Ice::Object> __createDelegateM();";
+ H << nl << "virtual ::IceInternal::Handle< ::IceDelegateD::Ice::Object> __createDelegateD();";
+ H << nl << "virtual ::IceProxy::Ice::Object* __newInstance() const;";
H << eb << ';';
C << sp;
@@ -2163,11 +2163,11 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
H << nl << "return begin_" << name << spar << argsAMI << "&__ctx" << "__del" << "__cookie" << epar << ';';
H << eb;
- H << sp << nl << _dllExport << retS << " end_" << name << spar << outParamsDeclAMI
+ H << sp << nl << retS << " end_" << name << spar << outParamsDeclAMI
<< "const ::Ice::AsyncResultPtr&" << epar << ';';
if(generatePrivateEnd)
{
- H << sp << nl << _dllExport << " void ___end_" << name << spar << outParamsDeclEndAMI;
+ H << sp << nl << " void ___end_" << name << spar << outParamsDeclEndAMI;
H << "const ::Ice::AsyncResultPtr&" << epar << ';';
}
@@ -2175,9 +2175,9 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
H.dec();
H << nl << "private:";
H.inc();
- H << sp << nl << _dllExport << retS << ' ' << fixKwd(name) << spar << params << "const ::Ice::Context*" << epar
+ H << sp << nl << retS << ' ' << fixKwd(name) << spar << params << "const ::Ice::Context*" << epar
<< ';';
- H << nl << _dllExport << "::Ice::AsyncResultPtr begin_" << name << spar << paramsAMI << "const ::Ice::Context*"
+ H << nl << "::Ice::AsyncResultPtr begin_" << name << spar << paramsAMI << "const ::Ice::Context*"
<< "const ::IceInternal::CallbackBasePtr&"
<< "const ::Ice::LocalObjectPtr& __cookie = 0" << epar << ';';
H << nl;
@@ -2411,9 +2411,9 @@ Slice::Gen::ProxyVisitor::visitOperation(const OperationPtr& p)
string classScopedAMI = classScope + classNameAMI;
string opScopedAMI = classScopedAMI + "_" + name;
- H << nl << _dllExport << "bool " << name << "_async" << spar << ("const " + opScopedAMI + "Ptr&")
+ H << nl << "bool " << name << "_async" << spar << ("const " + opScopedAMI + "Ptr&")
<< paramsAMI << epar << ';';
- H << nl << _dllExport << "bool " << name << "_async" << spar << ("const " + opScopedAMI + "Ptr&")
+ H << nl << "bool " << name << "_async" << spar << ("const " + opScopedAMI + "Ptr&")
<< paramsAMI << "const ::Ice::Context&" << epar << ';';
C << sp << nl << "bool" << nl << "IceProxy" << scope << name << "_async" << spar