qpid-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From acon...@apache.org
Subject [10/38] qpid-proton git commit: PROTON-1403: c proactor library windows fixes.
Date Thu, 23 Feb 2017 22:51:17 GMT
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 <aconway@redhat.com>
Authored: Fri Feb 10 22:08:23 2017 -0500
Committer: Alan Conway <aconway@redhat.com>
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 <proton/sasl.h>
 #include <proton/transport.h>
 #include <proton/url.h>
+#include "pncompat/misc_funcs.inc"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 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 <proton/session.h>
 #include <proton/transport.h>
 #include <proton/url.h>
+#include "pncompat/misc_funcs.inc"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 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 <proton/session.h>
 #include <proton/transport.h>
 #include <proton/url.h>
+#include "pncompat/misc_funcs.inc"
 
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <unistd.h>
 
 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


Mime
View raw message