PROTON-250: [C++ binding] Hide symbol visibility - Make necessary C++ symbols visible
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/525fad99 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/525fad99 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/525fad99 Branch: refs/heads/master Commit: 525fad994b2610f9d1c6ee92dddc419cd5c2d180 Parents: 0576b60 Author: Andrew Stitcher <[email protected]> Authored: Wed Feb 10 15:54:18 2016 -0500 Committer: Andrew Stitcher <[email protected]> Committed: Mon Feb 15 15:04:29 2016 -0500 ---------------------------------------------------------------------- proton-c/bindings/cpp/CMakeLists.txt | 4 ++-- .../bindings/cpp/include/proton/connection.hpp | 3 ++- .../cpp/include/proton/connection_engine.hpp | 3 ++- proton-c/bindings/cpp/include/proton/endpoint.hpp | 3 ++- proton-c/bindings/cpp/include/proton/error.hpp | 18 ++++++++++++------ proton-c/bindings/cpp/include/proton/export.hpp | 8 +++++++- proton-c/bindings/cpp/include/proton/handler.hpp | 3 ++- proton-c/bindings/cpp/include/proton/link.hpp | 3 ++- proton-c/bindings/cpp/include/proton/receiver.hpp | 3 ++- proton-c/bindings/cpp/include/proton/sender.hpp | 3 ++- proton-c/bindings/cpp/include/proton/session.hpp | 3 ++- proton-c/bindings/cpp/include/proton/url.hpp | 3 ++- 12 files changed, 39 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/CMakeLists.txt b/proton-c/bindings/cpp/CMakeLists.txt index 4ad015a..7c1c41d 100644 --- a/proton-c/bindings/cpp/CMakeLists.txt +++ b/proton-c/bindings/cpp/CMakeLists.txt @@ -79,7 +79,7 @@ endif(MSVC) set_source_files_properties ( ${qpid-proton-cpp-source} PROPERTIES - COMPILE_FLAGS "${CXX_WARNING_FLAGS}" + COMPILE_FLAGS "${CXX_WARNING_FLAGS} ${LTO}" ) add_library(qpid-proton-cpp SHARED ${qpid-proton-cpp-source}) @@ -92,7 +92,7 @@ set_target_properties ( LINKER_LANGUAGE CXX VERSION "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}" SOVERSION "${PN_LIB_SOMAJOR}" - LINK_FLAGS "${CATCH_UNDEFINED}" + LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) ## Install http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/connection.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/connection.hpp b/proton-c/bindings/cpp/include/proton/connection.hpp index 75c7338..d22f313 100644 --- a/proton-c/bindings/cpp/include/proton/connection.hpp +++ b/proton-c/bindings/cpp/include/proton/connection.hpp @@ -38,7 +38,8 @@ namespace proton { class handler; /// A connection to a remote AMQP peer. -class connection : public object<pn_connection_t>, public endpoint { +class +PN_CPP_CLASS_EXTERN connection : public object<pn_connection_t>, public endpoint { public: /// @cond INTERNAL connection(pn_connection_t* c=0) : object<pn_connection_t>(c) {} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/connection_engine.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/connection_engine.hpp b/proton-c/bindings/cpp/include/proton/connection_engine.hpp index 367f7aa..beeefc5 100644 --- a/proton-c/bindings/cpp/include/proton/connection_engine.hpp +++ b/proton-c/bindings/cpp/include/proton/connection_engine.hpp @@ -61,7 +61,8 @@ class connection; /// /// THREAD SAFETY: A single engine instance cannot be called concurrently, but /// different engine instances can be processed concurrently in separate threads. -class connection_engine { +class +PN_CPP_CLASS_EXTERN connection_engine { public: // FIXME aconway 2016-01-23: DOC class container { http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/endpoint.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/endpoint.hpp b/proton-c/bindings/cpp/include/proton/endpoint.hpp index 94814f1..6f3af4d 100644 --- a/proton-c/bindings/cpp/include/proton/endpoint.hpp +++ b/proton-c/bindings/cpp/include/proton/endpoint.hpp @@ -29,7 +29,8 @@ namespace proton { /// The base class for session, connection, and link. -class endpoint { +class +PN_CPP_CLASS_EXTERN endpoint { public: PN_CPP_EXTERN virtual ~endpoint(); http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/error.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/error.hpp b/proton-c/bindings/cpp/include/proton/error.hpp index d4d5622..aa579f9 100644 --- a/proton-c/bindings/cpp/include/proton/error.hpp +++ b/proton-c/bindings/cpp/include/proton/error.hpp @@ -34,7 +34,8 @@ namespace proton { /// /// All exceptions thrown from functions in the proton namespace are /// subclasses of proton::error. -struct error : public std::runtime_error { +struct +PN_CPP_CLASS_EXTERN error : public std::runtime_error { /// @cond INTERNAL /// XXX do we intend users to construct these (and subclasses)? PN_CPP_EXTERN explicit error(const std::string&); @@ -42,7 +43,8 @@ struct error : public std::runtime_error { }; /// Raised if a timeout expires. -struct timeout_error : public error { +struct +PN_CPP_CLASS_EXTERN timeout_error : public error { /// @cond INTERNAL PN_CPP_EXTERN explicit timeout_error(const std::string&); /// @endcond @@ -52,12 +54,14 @@ struct timeout_error : public error { /// XXX change namespace /// Raised if there is an error decoding AMQP data as a C++ value. -struct decode_error : public error { +struct +PN_CPP_CLASS_EXTERN decode_error : public error { PN_CPP_EXTERN explicit decode_error(const std::string&); }; /// Raised if there is an error encoding a C++ value as AMQP data. -struct encode_error : public error { +struct +PN_CPP_CLASS_EXTERN encode_error : public error { PN_CPP_EXTERN explicit encode_error(const std::string&); }; @@ -67,12 +71,14 @@ struct encode_error : public error { /// XXX need to discuss /// Error reading or writing external IO. -struct io_error : public error { +struct +PN_CPP_CLASS_EXTERN io_error : public error { PN_CPP_EXTERN explicit io_error(const std::string&); }; /// Attempt to use a closed resource (connnection, session, or link). -struct closed_error : public io_error { +struct +PN_CPP_CLASS_EXTERN closed_error : public io_error { PN_CPP_EXTERN explicit closed_error(const std::string& = default_msg); static const std::string default_msg; }; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/export.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/export.hpp b/proton-c/bindings/cpp/include/proton/export.hpp index 2eb330c..788235f 100644 --- a/proton-c/bindings/cpp/include/proton/export.hpp +++ b/proton-c/bindings/cpp/include/proton/export.hpp @@ -31,19 +31,25 @@ // # define PN_CPP_EXPORT __declspec(dllexport) # define PN_CPP_IMPORT __declspec(dllimport) +# define PN_CPP_CLASS_EXPORT +# define PN_CPP_CLASS_IMPORT #else // // Non-Windows (Linux, etc.) definitions: // -# define PN_CPP_EXPORT +# define PN_CPP_EXPORT __attribute ((visibility ("default"))) # define PN_CPP_IMPORT +# define PN_CPP_CLASS_EXPORT __attribute ((visibility ("default"))) +# define PN_CPP_CLASS_IMPORT #endif // For qpid-proton-cpp library symbols #ifdef qpid_proton_cpp_EXPORTS # define PN_CPP_EXTERN PN_CPP_EXPORT +# define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_EXPORT #else # define PN_CPP_EXTERN PN_CPP_IMPORT +# define PN_CPP_CLASS_EXTERN PN_CPP_CLASS_IMPORT #endif /// @endcond http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/handler.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/handler.hpp b/proton-c/bindings/cpp/include/proton/handler.hpp index 44fad03..83a80d2 100644 --- a/proton-c/bindings/cpp/include/proton/handler.hpp +++ b/proton-c/bindings/cpp/include/proton/handler.hpp @@ -37,7 +37,8 @@ class messaging_adapter; /// Subclass and override event-handling member functions. /// /// @see proton::event -class handler +class +PN_CPP_CLASS_EXTERN handler { public: /// @cond INTERNAL http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/link.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/link.hpp b/proton-c/bindings/cpp/include/proton/link.hpp index 7e86af5..e9fb51b 100644 --- a/proton-c/bindings/cpp/include/proton/link.hpp +++ b/proton-c/bindings/cpp/include/proton/link.hpp @@ -40,7 +40,8 @@ class condition; /// A named channel for sending or receiving messages. It is the base /// class for sender and receiver. -class link : public object<pn_link_t> , public endpoint { +class +PN_CPP_CLASS_EXTERN link : public object<pn_link_t> , public endpoint { public: /// @cond INTERNAL link(pn_link_t* l=0) : object<pn_link_t>(l) {} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/receiver.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/receiver.hpp b/proton-c/bindings/cpp/include/proton/receiver.hpp index 11569e4..49f5ae8 100644 --- a/proton-c/bindings/cpp/include/proton/receiver.hpp +++ b/proton-c/bindings/cpp/include/proton/receiver.hpp @@ -33,7 +33,8 @@ struct pn_connection_t; namespace proton { /// A link for receiving messages. -class receiver : public link { +class +PN_CPP_CLASS_EXTERN receiver : public link { public: /// @cond INTERNAL receiver(pn_link_t* r=0) : link(r) {} http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/sender.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/sender.hpp b/proton-c/bindings/cpp/include/proton/sender.hpp index 17849770..7c9ffb1 100644 --- a/proton-c/bindings/cpp/include/proton/sender.hpp +++ b/proton-c/bindings/cpp/include/proton/sender.hpp @@ -35,7 +35,8 @@ struct pn_connection_t; namespace proton { /// A link for sending messages. -class sender : public link +class +PN_CPP_CLASS_EXTERN sender : public link { public: /// @cond INTERNAL http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/session.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/session.hpp b/proton-c/bindings/cpp/include/proton/session.hpp index a16fbe3..73009e1 100644 --- a/proton-c/bindings/cpp/include/proton/session.hpp +++ b/proton-c/bindings/cpp/include/proton/session.hpp @@ -39,7 +39,8 @@ class container; class handler; /// A container of links. -class session : public object<pn_session_t>, public endpoint +class +PN_CPP_CLASS_EXTERN session : public object<pn_session_t>, public endpoint { public: /// @cond INTERNAL http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/525fad99/proton-c/bindings/cpp/include/proton/url.hpp ---------------------------------------------------------------------- diff --git a/proton-c/bindings/cpp/include/proton/url.hpp b/proton-c/bindings/cpp/include/proton/url.hpp index 62aa6a0..ccf3f1e 100644 --- a/proton-c/bindings/cpp/include/proton/url.hpp +++ b/proton-c/bindings/cpp/include/proton/url.hpp @@ -30,7 +30,8 @@ struct pn_url_t; namespace proton { /// Raised if URL parsing fails. -struct url_error : public error { +struct +PN_CPP_CLASS_EXTERN url_error : public error { /// @cond INTERNAL PN_CPP_EXTERN explicit url_error(const std::string&); /// @endcond --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
