Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 13CAF200C36 for ; Thu, 23 Feb 2017 23:51:11 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 12B4A160B64; Thu, 23 Feb 2017 22:51:11 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id D1497160B80 for ; Thu, 23 Feb 2017 23:51:09 +0100 (CET) Received: (qmail 76358 invoked by uid 500); 23 Feb 2017 22:51:08 -0000 Mailing-List: contact commits-help@qpid.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@qpid.apache.org Delivered-To: mailing list commits@qpid.apache.org Received: (qmail 76003 invoked by uid 99); 23 Feb 2017 22:51:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 23 Feb 2017 22:51:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id 61881DFF83; Thu, 23 Feb 2017 22:51:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: aconway@apache.org To: commits@qpid.apache.org Date: Thu, 23 Feb 2017 22:51:17 -0000 Message-Id: <7a182bfae68c4a59944ee222d89e15cd@git.apache.org> In-Reply-To: <18e12ab11c6247358369966c9b6620b7@git.apache.org> References: <18e12ab11c6247358369966c9b6620b7@git.apache.org> X-Mailer: ASF-Git Admin Mailer Subject: [10/38] qpid-proton git commit: PROTON-1403: c proactor library windows fixes. archived-at: Thu, 23 Feb 2017 22:51:11 -0000 PROTON-1403: c proactor library windows fixes. Don't build the proactor lib and examples unless there is one for the platform. Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/1d4fe545 Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/1d4fe545 Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/1d4fe545 Branch: refs/heads/go1 Commit: 1d4fe545e394d1b0eed57dcf36624565f20d69b8 Parents: ec70d73 Author: Alan Conway Authored: Fri Feb 10 22:08:23 2017 -0500 Committer: Alan Conway Committed: Fri Feb 10 22:39:01 2017 -0500 ---------------------------------------------------------------------- examples/c/CMakeLists.txt | 8 ++++++-- examples/c/proactor/broker.c | 6 +++--- examples/c/proactor/receive.c | 6 +++--- examples/c/proactor/send.c | 6 +++--- proton-c/CMakeLists.txt | 17 ++++++++++------- 5 files changed, 25 insertions(+), 18 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d4fe545/examples/c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/examples/c/CMakeLists.txt b/examples/c/CMakeLists.txt index 0d0c7e9..b2f36d3 100644 --- a/examples/c/CMakeLists.txt +++ b/examples/c/CMakeLists.txt @@ -19,9 +19,13 @@ find_package(Proton REQUIRED) include(CheckCCompilerFlag) - +include(CheckFunctionExists) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/include) -add_subdirectory(proactor) +check_function_exists(pn_proactor, HAS_PROACTOR) +if (HAS_PROACTOR) + add_subdirectory(proactor) +endif() + add_subdirectory(messenger) add_subdirectory(reactor) http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d4fe545/examples/c/proactor/broker.c ---------------------------------------------------------------------- diff --git a/examples/c/proactor/broker.c b/examples/c/proactor/broker.c index d6261f4..5679290 100644 --- a/examples/c/proactor/broker.c +++ b/examples/c/proactor/broker.c @@ -25,11 +25,11 @@ #include #include #include +#include "pncompat/misc_funcs.inc" #include #include #include -#include bool enable_debug = false; @@ -435,8 +435,8 @@ int main(int argc, char **argv) { /* Command line options */ char *urlstr = NULL; char container_id[256]; - /* Default container-id is program:pid */ - snprintf(container_id, sizeof(container_id), "%s:%d", argv[0], getpid()); + /* Note container-id should be unique */ + snprintf(container_id, sizeof(container_id), "%s", argv[0]); size_t nthreads = 4; pn_millis_t heartbeat = 0; int opt; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d4fe545/examples/c/proactor/receive.c ---------------------------------------------------------------------- diff --git a/examples/c/proactor/receive.c b/examples/c/proactor/receive.c index b8edcd6..1eb54b6 100644 --- a/examples/c/proactor/receive.c +++ b/examples/c/proactor/receive.c @@ -28,11 +28,11 @@ #include #include #include +#include "pncompat/misc_funcs.inc" #include #include #include -#include typedef char str[1024]; @@ -176,8 +176,8 @@ int main(int argc, char **argv) { } if (optind < argc) usage(argv[0]); - - snprintf(app.container_id, sizeof(app.container_id), "%s:%d", argv[0], getpid()); + /* Note container-id should be unique */ + snprintf(app.container_id, sizeof(app.container_id), "%s", argv[0]); /* Parse the URL or use default values */ pn_url_t *url = urlstr ? pn_url_parse(urlstr) : NULL; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d4fe545/examples/c/proactor/send.c ---------------------------------------------------------------------- diff --git a/examples/c/proactor/send.c b/examples/c/proactor/send.c index d611b3d..48fcecd 100644 --- a/examples/c/proactor/send.c +++ b/examples/c/proactor/send.c @@ -28,11 +28,11 @@ #include #include #include +#include "pncompat/misc_funcs.inc" #include #include #include -#include typedef char str[1024]; @@ -205,8 +205,8 @@ int main(int argc, char **argv) { } if (optind < argc) usage(argv[0]); - - snprintf(app.container_id, sizeof(app.container_id), "%s:%d", argv[0], getpid()); + /* Note container-id should be unique */ + snprintf(app.container_id, sizeof(app.container_id), "%s", argv[0]); /* Parse the URL or use default values */ pn_url_t *url = urlstr ? pn_url_parse(urlstr) : NULL; http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/1d4fe545/proton-c/CMakeLists.txt ---------------------------------------------------------------------- diff --git a/proton-c/CMakeLists.txt b/proton-c/CMakeLists.txt index e5552c5..c73f9df 100644 --- a/proton-c/CMakeLists.txt +++ b/proton-c/CMakeLists.txt @@ -541,12 +541,6 @@ set_target_properties ( LINK_FLAGS "${CATCH_UNDEFINED} ${LTO}" ) -add_library ( - qpid-proton-proactor SHARED - ${qpid-proton-proactor} - ) -target_link_libraries (qpid-proton-proactor qpid-proton-core ${PROACTOR_LIBS}) - add_library( qpid-proton SHARED # Proton Core @@ -627,7 +621,16 @@ endmacro() configure_lib(PROTONLIB qpid-proton) configure_lib(PROTONCORELIB qpid-proton-core) -configure_lib(PROTONPROACTORLIB qpid-proton-proactor) + +if (qpid-proton-proactor) + add_library ( + qpid-proton-proactor SHARED + ${qpid-proton-proactor} + ) + target_link_libraries (qpid-proton-proactor qpid-proton-core ${PROACTOR_LIBS}) + configure_lib(PROTONPROACTORLIB qpid-proton-proactor) +endif() + include(WriteBasicConfigVersionFile) --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org For additional commands, e-mail: commits-help@qpid.apache.org