You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by as...@apache.org on 2016/02/15 21:12:34 UTC
[1/5] qpid-proton git commit: PROTON-250: [C] Hide symbol visibility
on Linux too (as well as Windows) - Also allow link time optimisation (lto)
(but initially default is disabled)
Repository: qpid-proton
Updated Branches:
refs/heads/master 13150e493 -> ca433506c
PROTON-250: [C] Hide symbol visibility on Linux too (as well as Windows)
- Also allow link time optimisation (lto) (but initially default is disabled)
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/0576b607
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/0576b607
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/0576b607
Branch: refs/heads/master
Commit: 0576b607e16292bd963997420323ebebb35ce3a6
Parents: c387e99
Author: Andrew Stitcher <as...@apache.org>
Authored: Wed Feb 10 15:43:20 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Feb 15 14:35:45 2016 -0500
----------------------------------------------------------------------
proton-c/CMakeLists.txt | 22 ++++++++++++++++++----
proton-c/include/proton/import_export.h | 2 +-
2 files changed, 19 insertions(+), 5 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0576b607/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index 4577bf0..acc876e 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -198,9 +198,12 @@ if (APPLE)
set (NOENABLE_UNDEFINED_ERROR ON)
endif (APPLE)
+# Make LTO default to off until we can figure out the valgrind issues
+set (NOENABLE_LINKTIME_OPTIMIZATION ON)
+
# Add options here called <whatever> they will turn into "ENABLE_<whatever" and can be
# overridden on a platform specific basis above by NOENABLE_<whatever>
-set (OPTIONS WARNING_ERROR UNDEFINED_ERROR)
+set (OPTIONS WARNING_ERROR UNDEFINED_ERROR LINKTIME_OPTIMIZATION HIDE_UNEXPORTED_SYMBOLS)
foreach (OPTION ${OPTIONS})
if (NOT NOENABLE_${OPTION})
@@ -211,6 +214,8 @@ endforeach (OPTION)
# And add the option here too with help text
option(ENABLE_WARNING_ERROR "Consider compiler warnings to be errors" ${DEFAULT_WARNING_ERROR})
option(ENABLE_UNDEFINED_ERROR "Check for unresolved library symbols" ${DEFAULT_UNDEFINED_ERROR})
+option(ENABLE_LINKTIME_OPTIMIZATION "Perform link time optimization" ${DEFAULT_LINKTIME_OPTIMIZATION})
+option(ENABLE_HIDE_UNEXPORTED_SYMBOLS "Only export library symbols that are explicitly requested" ${DEFAULT_HIDE_UNEXPORTED_SYMBOLS})
# Set any additional compiler specific flags
if (CMAKE_COMPILER_IS_GNUCC)
@@ -241,6 +246,15 @@ if (CMAKE_COMPILER_IS_GNUCC)
set (CATCH_UNDEFINED "-Wl,--no-undefined")
set (ALLOW_UNDEFINED "-Wl,--allow-shlib-undefined")
endif (ENABLE_UNDEFINED_ERROR)
+
+ if (ENABLE_LINKTIME_OPTIMIZATION)
+ set (LTO "-flto")
+ endif (ENABLE_LINKTIME_OPTIMIZATION)
+
+ if (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
+ set (CMAKE_C_FLAGS "-fvisibility=hidden")
+ set (CMAKE_CXX_FLAGS "-fvisibility=hidden")
+ endif (ENABLE_HIDE_UNEXPORTED_SYMBOLS)
endif (CMAKE_COMPILER_IS_GNUCC)
if (CMAKE_CXX_COMPILER_ID MATCHES "Clang")
@@ -381,13 +395,13 @@ source_group("API Header Files" FILES ${qpid-proton-include})
set_source_files_properties (
${qpid-proton-core}
PROPERTIES
- COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS}"
+ COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_LANGUAGE_FLAGS} ${LTO}"
)
set_source_files_properties (
${qpid-proton-platform}
PROPERTIES
- COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
+ COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS} ${LTO}"
COMPILE_DEFINITIONS "${PLATFORM_DEFINITIONS}"
)
@@ -406,7 +420,7 @@ set_target_properties (
PROPERTIES
VERSION "${PN_LIB_SOMAJOR}.${PN_LIB_SOMINOR}"
SOVERSION "${PN_LIB_SOMAJOR}"
- LINK_FLAGS "${CATCH_UNDEFINED}"
+ LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}"
)
if (MSVC)
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/0576b607/proton-c/include/proton/import_export.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/import_export.h b/proton-c/include/proton/import_export.h
index dede08c..4534d68 100644
--- a/proton-c/include/proton/import_export.h
+++ b/proton-c/include/proton/import_export.h
@@ -40,7 +40,7 @@
//
// Non-Windows (Linux, etc.) definitions:
//
-# define PN_EXPORT
+# define PN_EXPORT __attribute ((visibility ("default")))
# define PN_IMPORT
#endif
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[5/5] qpid-proton git commit: PROTON-250: Adjust proton-dump to keep
on compiling: - It uses proton-c internals so some files from proton are
compiled explicitly with proton-dump. Perhaps making a static proton would be
a better solution. - Do the tr
Posted by as...@apache.org.
PROTON-250: Adjust proton-dump to keep on compiling:
- It uses proton-c internals so some files from proton are compiled
explicitly with proton-dump. Perhaps making a static proton would
be a better solution.
- Do the trivial arglist scanning manually instead of using getopt
- Fix a change in include path missed in the test tools.
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/ca433506
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/ca433506
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/ca433506
Branch: refs/heads/master
Commit: ca433506c346f088077bb786d5544e419b210cf7
Parents: 874d85b
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Feb 15 14:33:14 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Feb 15 15:05:06 2016 -0500
----------------------------------------------------------------------
proton-c/CMakeLists.txt | 14 +++++++++-----
proton-c/src/proton-dump.c | 16 ++++------------
tests/tools/apps/c/CMakeLists.txt | 2 +-
3 files changed, 14 insertions(+), 18 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index acc876e..862a520 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -92,10 +92,6 @@ include_directories ("${CMAKE_CURRENT_BINARY_DIR}/include")
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/src")
include_directories ("${CMAKE_CURRENT_SOURCE_DIR}/include")
-# TODO: This is only needed because the proton executable can use getopt on windows
-# if/when this executable gets sorted out remove
-include_directories ("${CMAKE_SOURCE_DIR}/examples/c/include")
-
set (env_py ${PYTHON_EXECUTABLE} ${CMAKE_CURRENT_SOURCE_DIR}/env.py)
add_custom_command (
@@ -428,13 +424,21 @@ if (MSVC)
include(WindowsC99CheckDef)
endif(MSVC)
-add_executable (proton-dump src/proton-dump.c)
+add_executable (
+ proton-dump
+ src/proton-dump.c
+ # Internal dependencies
+ src/buffer.c
+ src/util.c
+ src/framing/framing.c
+ )
target_link_libraries (proton-dump qpid-proton)
set_target_properties (
proton-dump
PROPERTIES
COMPILE_FLAGS "${COMPILE_WARNING_FLAGS} ${COMPILE_PLATFORM_FLAGS}"
+ LINK_FLAGS "${LTO}"
)
macro(pn_c_files)
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/proton-c/src/proton-dump.c
----------------------------------------------------------------------
diff --git a/proton-c/src/proton-dump.c b/proton-c/src/proton-dump.c
index 1ce577d..0da65eb 100644
--- a/proton-c/src/proton-dump.c
+++ b/proton-c/src/proton-dump.c
@@ -19,8 +19,6 @@
*
*/
-#include "pncompat/misc_funcs.inc"
-
#include <stdio.h>
#include <proton/codec.h>
#include <proton/error.h>
@@ -128,16 +126,10 @@ int main(int argc, char **argv)
return 0;
}
- int c;
-
- while ( (c = getopt(argc, argv, "h")) != -1 ) {
- switch(c) {
- case 'h':
- usage(argv[0]);
- return 0;
- break;
-
- case '?':
+ // There are no actual options for proton-dump so just scan for anything
+ // starting with '-' and print the usage message if we find something.
+ for (int c = 1; c < argc; c++) {
+ if (*argv[c]=='-') {
usage(argv[0]);
return 1;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/ca433506/tests/tools/apps/c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/tests/tools/apps/c/CMakeLists.txt b/tests/tools/apps/c/CMakeLists.txt
index 9507c1f..2c801c4 100644
--- a/tests/tools/apps/c/CMakeLists.txt
+++ b/tests/tools/apps/c/CMakeLists.txt
@@ -19,7 +19,7 @@
include(CheckIncludeFiles)
-include_directories(${CMAKE_SOURCE_DIR}/examples/include)
+include_directories(${CMAKE_SOURCE_DIR}/examples/c/include)
CHECK_INCLUDE_FILES("inttypes.h" INTTYPES_AVAILABLE)
if (INTTYPES_AVAILABLE)
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[4/5] qpid-proton git commit: PROTON-250: Fix misc symbol visibility
issues: - Hide all library internal only symbols - Make log.h export only
unmangled C symbols
Posted by as...@apache.org.
PROTON-250: Fix misc symbol visibility issues:
- Hide all library internal only symbols
- Make log.h export only unmangled C symbols
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/874d85b2
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/874d85b2
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/874d85b2
Branch: refs/heads/master
Commit: 874d85b2d6ec53e4ca9e75c3018862f84cf18300
Parents: 525fad9
Author: Andrew Stitcher <as...@apache.org>
Authored: Fri Feb 12 01:00:13 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Feb 15 15:05:06 2016 -0500
----------------------------------------------------------------------
proton-c/include/proton/log.h | 14 +++++++++++---
proton-c/src/buffer.h | 30 ++++++++++++++---------------
proton-c/src/framing/framing.h | 4 ++--
proton-c/src/log_private.h | 6 +++---
proton-c/src/messenger/messenger.c | 8 ++++----
proton-c/src/url.c | 34 ++++++++++++++++-----------------
proton-c/src/util.h | 8 ++++----
7 files changed, 56 insertions(+), 48 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/include/proton/log.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/log.h b/proton-c/include/proton/log.h
index a194e8c..1387df5 100644
--- a/proton-c/include/proton/log.h
+++ b/proton-c/include/proton/log.h
@@ -19,15 +19,19 @@
* under the License.
*/
+#include <proton/import_export.h>
+#include <proton/type_compat.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
/**@file
*
* Control log messages that are not associated with a transport.
* See pn_transport_trace for transport-related logging.
*/
-#include <proton/import_export.h>
-#include <proton/type_compat.h>
-
/** Callback for customized logging. */
typedef void (*pn_logger_t)(const char *message);
@@ -47,4 +51,8 @@ PN_EXTERN void pn_log_enable(bool enabled);
*/
PN_EXTERN void pn_log_logger(pn_logger_t logger);
+#ifdef __cplusplus
+}
+#endif
+
#endif
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/buffer.h
----------------------------------------------------------------------
diff --git a/proton-c/src/buffer.h b/proton-c/src/buffer.h
index 26d4bb3..94d48ac 100644
--- a/proton-c/src/buffer.h
+++ b/proton-c/src/buffer.h
@@ -36,21 +36,21 @@ typedef struct {
typedef struct pn_buffer_t pn_buffer_t;
-PN_EXTERN pn_buffer_t *pn_buffer(size_t capacity);
-PN_EXTERN void pn_buffer_free(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_size(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_capacity(pn_buffer_t *buf);
-PN_EXTERN size_t pn_buffer_available(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
-PN_EXTERN int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
-PN_EXTERN int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
-PN_EXTERN size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
-PN_EXTERN int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
-PN_EXTERN void pn_buffer_clear(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_defrag(pn_buffer_t *buf);
-PN_EXTERN pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
-PN_EXTERN pn_buffer_memory_t pn_buffer_memory(pn_buffer_t *buf);
-PN_EXTERN int pn_buffer_print(pn_buffer_t *buf);
+pn_buffer_t *pn_buffer(size_t capacity);
+void pn_buffer_free(pn_buffer_t *buf);
+size_t pn_buffer_size(pn_buffer_t *buf);
+size_t pn_buffer_capacity(pn_buffer_t *buf);
+size_t pn_buffer_available(pn_buffer_t *buf);
+int pn_buffer_ensure(pn_buffer_t *buf, size_t size);
+int pn_buffer_append(pn_buffer_t *buf, const char *bytes, size_t size);
+int pn_buffer_prepend(pn_buffer_t *buf, const char *bytes, size_t size);
+size_t pn_buffer_get(pn_buffer_t *buf, size_t offset, size_t size, char *dst);
+int pn_buffer_trim(pn_buffer_t *buf, size_t left, size_t right);
+void pn_buffer_clear(pn_buffer_t *buf);
+int pn_buffer_defrag(pn_buffer_t *buf);
+pn_bytes_t pn_buffer_bytes(pn_buffer_t *buf);
+pn_buffer_memory_t pn_buffer_memory(pn_buffer_t *buf);
+int pn_buffer_print(pn_buffer_t *buf);
#ifdef __cplusplus
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/framing/framing.h
----------------------------------------------------------------------
diff --git a/proton-c/src/framing/framing.h b/proton-c/src/framing/framing.h
index 9849fef..6033867 100644
--- a/proton-c/src/framing/framing.h
+++ b/proton-c/src/framing/framing.h
@@ -42,8 +42,8 @@ typedef struct {
const char *payload;
} pn_frame_t;
-PN_EXTERN ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max);
-PN_EXTERN size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
+ssize_t pn_read_frame(pn_frame_t *frame, const char *bytes, size_t available, uint32_t max);
+size_t pn_write_frame(char *bytes, size_t size, pn_frame_t frame);
#ifdef __cplusplus
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/log_private.h
----------------------------------------------------------------------
diff --git a/proton-c/src/log_private.h b/proton-c/src/log_private.h
index 828e189..4725045 100644
--- a/proton-c/src/log_private.h
+++ b/proton-c/src/log_private.h
@@ -42,12 +42,12 @@
} while(0)
/** Return true if logging is enabled. */
-PN_EXTERN bool pn_log_enabled(void);
+bool pn_log_enabled(void);
/**@internal*/
-PN_EXTERN void pn_logf_impl(const char* fmt, ...);
+void pn_logf_impl(const char* fmt, ...);
/**@internal*/
-PN_EXTERN void pn_vlogf_impl(const char *fmt, va_list ap);
+void pn_vlogf_impl(const char *fmt, va_list ap);
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/messenger/messenger.c
----------------------------------------------------------------------
diff --git a/proton-c/src/messenger/messenger.c b/proton-c/src/messenger/messenger.c
index cd6585b..a376988 100644
--- a/proton-c/src/messenger/messenger.c
+++ b/proton-c/src/messenger/messenger.c
@@ -1699,7 +1699,7 @@ pn_connection_t *pn_messenger_resolve(pn_messenger_t *messenger, const char *add
return connection;
}
-PN_EXTERN pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger,
+pn_link_t *pn_messenger_get_link(pn_messenger_t *messenger,
const char *address, bool sender)
{
char *name = NULL;
@@ -2292,7 +2292,7 @@ int pn_messenger_reject(pn_messenger_t *messenger, pn_tracker_t tracker, int fla
PN_STATUS_REJECTED, flags, false, false);
}
-PN_EXTERN pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger,
+pn_link_t *pn_messenger_tracker_link(pn_messenger_t *messenger,
pn_tracker_t tracker)
{
pni_store_t *store = pn_tracker_store(messenger, tracker);
@@ -2353,7 +2353,7 @@ int pn_messenger_rewrite(pn_messenger_t *messenger, const char *pattern, const c
return 0;
}
-PN_EXTERN int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags)
+int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags)
{
if (!messenger)
return PN_ARG_ERR;
@@ -2363,7 +2363,7 @@ PN_EXTERN int pn_messenger_set_flags(pn_messenger_t *messenger, const int flags)
return 0;
}
-PN_EXTERN int pn_messenger_get_flags(pn_messenger_t *messenger)
+int pn_messenger_get_flags(pn_messenger_t *messenger)
{
return messenger ? messenger->flags : 0;
}
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/url.c
----------------------------------------------------------------------
diff --git a/proton-c/src/url.c b/proton-c/src/url.c
index 1e70f19..566e91e 100644
--- a/proton-c/src/url.c
+++ b/proton-c/src/url.c
@@ -85,7 +85,7 @@ static int pn_url_inspect(void *obj, pn_string_t *dst)
#define pn_url_initialize NULL
-PN_EXTERN pn_url_t *pn_url() {
+pn_url_t *pn_url() {
static const pn_class_t clazz = PN_CLASS(pn_url);
pn_url_t *url = (pn_url_t*) pn_class_new(&clazz, sizeof(pn_url_t));
if (!url) return NULL;
@@ -98,7 +98,7 @@ PN_EXTERN pn_url_t *pn_url() {
*@param[in] url A URL string.
*@return The parsed pn_url_t or NULL if url is not a valid URL string.
*/
-PN_EXTERN pn_url_t *pn_url_parse(const char *str) {
+pn_url_t *pn_url_parse(const char *str) {
if (!str || !*str) /* Empty string or NULL is illegal. */
return NULL;
@@ -117,10 +117,10 @@ PN_EXTERN pn_url_t *pn_url_parse(const char *str) {
}
/** Free a URL */
-PN_EXTERN void pn_url_free(pn_url_t *url) { pn_free(url); }
+void pn_url_free(pn_url_t *url) { pn_free(url); }
/** Clear the contents of the URL. */
-PN_EXTERN void pn_url_clear(pn_url_t *url) {
+void pn_url_clear(pn_url_t *url) {
pn_url_set_scheme(url, NULL);
pn_url_set_username(url, NULL);
pn_url_set_password(url, NULL);
@@ -148,7 +148,7 @@ static void pni_urlencode(pn_string_t *dst, const char* src) {
/** Return the string form of a URL. */
-PN_EXTERN const char *pn_url_str(pn_url_t *url) {
+const char *pn_url_str(pn_url_t *url) {
if (pn_string_get(url->str) == NULL) {
pn_string_set(url->str, "");
if (url->scheme) pn_string_addf(url->str, "%s://", url->scheme);
@@ -168,19 +168,19 @@ PN_EXTERN const char *pn_url_str(pn_url_t *url) {
return pn_string_get(url->str);
}
-PN_EXTERN const char *pn_url_get_scheme(pn_url_t *url) { return url->scheme; }
-PN_EXTERN const char *pn_url_get_username(pn_url_t *url) { return url->username; }
-PN_EXTERN const char *pn_url_get_password(pn_url_t *url) { return url->password; }
-PN_EXTERN const char *pn_url_get_host(pn_url_t *url) { return url->host; }
-PN_EXTERN const char *pn_url_get_port(pn_url_t *url) { return url->port; }
-PN_EXTERN const char *pn_url_get_path(pn_url_t *url) { return url->path; }
+const char *pn_url_get_scheme(pn_url_t *url) { return url->scheme; }
+const char *pn_url_get_username(pn_url_t *url) { return url->username; }
+const char *pn_url_get_password(pn_url_t *url) { return url->password; }
+const char *pn_url_get_host(pn_url_t *url) { return url->host; }
+const char *pn_url_get_port(pn_url_t *url) { return url->port; }
+const char *pn_url_get_path(pn_url_t *url) { return url->path; }
#define SET(part) free(url->part); url->part = copy(part); pn_string_clear(url->str)
-PN_EXTERN void pn_url_set_scheme(pn_url_t *url, const char *scheme) { SET(scheme); }
-PN_EXTERN void pn_url_set_username(pn_url_t *url, const char *username) { SET(username); }
-PN_EXTERN void pn_url_set_password(pn_url_t *url, const char *password) { SET(password); }
-PN_EXTERN void pn_url_set_host(pn_url_t *url, const char *host) { SET(host); }
-PN_EXTERN void pn_url_set_port(pn_url_t *url, const char *port) { SET(port); }
-PN_EXTERN void pn_url_set_path(pn_url_t *url, const char *path) { SET(path); }
+void pn_url_set_scheme(pn_url_t *url, const char *scheme) { SET(scheme); }
+void pn_url_set_username(pn_url_t *url, const char *username) { SET(username); }
+void pn_url_set_password(pn_url_t *url, const char *password) { SET(password); }
+void pn_url_set_host(pn_url_t *url, const char *host) { SET(host); }
+void pn_url_set_port(pn_url_t *url, const char *port) { SET(port); }
+void pn_url_set_path(pn_url_t *url, const char *path) { SET(path); }
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/874d85b2/proton-c/src/util.h
----------------------------------------------------------------------
diff --git a/proton-c/src/util.h b/proton-c/src/util.h
index 8973a07..ec59a07 100644
--- a/proton-c/src/util.h
+++ b/proton-c/src/util.h
@@ -32,13 +32,13 @@
#include <proton/types.h>
#include <proton/object.h>
-PN_EXTERN void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path);
+void pni_parse_url(char *url, char **scheme, char **user, char **pass, char **host, char **port, char **path);
void pni_fatal(const char *fmt, ...);
void pni_vfatal(const char *fmt, va_list ap);
-PN_EXTERN ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size);
+ssize_t pn_quote_data(char *dst, size_t capacity, const char *src, size_t size);
int pn_quote(pn_string_t *dst, const char *src, size_t size);
-PN_EXTERN void pn_fprint_data(FILE *stream, const char *bytes, size_t size);
-PN_EXTERN void pn_print_data(const char *bytes, size_t size);
+void pn_fprint_data(FILE *stream, const char *bytes, size_t size);
+void pn_print_data(const char *bytes, size_t size);
bool pn_env_bool(const char *name);
pn_timestamp_t pn_timestamp_min(pn_timestamp_t a, pn_timestamp_t b);
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[2/5] qpid-proton git commit: NO-JIRA: Fix CMake to avoid new policy
warning
Posted by as...@apache.org.
NO-JIRA: Fix CMake to avoid new policy warning
Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/c387e999
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/c387e999
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/c387e999
Branch: refs/heads/master
Commit: c387e999f8204fb03f1a276a68596df50c1e0872
Parents: 13150e4
Author: Andrew Stitcher <as...@apache.org>
Authored: Mon Feb 15 14:34:32 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
Committed: Mon Feb 15 14:35:45 2016 -0500
----------------------------------------------------------------------
proton-c/CMakeLists.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/c387e999/proton-c/CMakeLists.txt
----------------------------------------------------------------------
diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt
index c3f9294..4577bf0 100644
--- a/proton-c/CMakeLists.txt
+++ b/proton-c/CMakeLists.txt
@@ -203,9 +203,9 @@ endif (APPLE)
set (OPTIONS WARNING_ERROR UNDEFINED_ERROR)
foreach (OPTION ${OPTIONS})
- if (NOT "NOENABLE_${OPTION}")
+ if (NOT NOENABLE_${OPTION})
set ("DEFAULT_${OPTION}" ON)
- endif (NOT "NOENABLE_${OPTION}")
+ endif ()
endforeach (OPTION)
# And add the option here too with help text
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org
[3/5] qpid-proton git commit: PROTON-250: [C++ binding] Hide symbol
visibility - Make necessary C++ symbols visible
Posted by as...@apache.org.
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 <as...@apache.org>
Authored: Wed Feb 10 15:54:18 2016 -0500
Committer: Andrew Stitcher <as...@apache.org>
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: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org