PROTON-629: Allow proton/delivery.h to be compiled as C89

Project: http://git-wip-us.apache.org/repos/asf/qpid-proton/repo
Commit: http://git-wip-us.apache.org/repos/asf/qpid-proton/commit/13150e49
Tree: http://git-wip-us.apache.org/repos/asf/qpid-proton/tree/13150e49
Diff: http://git-wip-us.apache.org/repos/asf/qpid-proton/diff/13150e49

Branch: refs/heads/master
Commit: 13150e4935d0de0bf390db4474b22c20e72a54e7
Parents: 958d009
Author: Andrew Stitcher <[email protected]>
Authored: Fri Feb 5 16:18:39 2016 -0500
Committer: Andrew Stitcher <[email protected]>
Committed: Mon Feb 15 13:55:09 2016 -0500

----------------------------------------------------------------------
 proton-c/bindings/python/cproton.i | 1 +
 proton-c/include/proton/delivery.h | 7 +------
 proton-c/src/engine/engine.c       | 5 +++++
 3 files changed, 7 insertions(+), 6 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/13150e49/proton-c/bindings/python/cproton.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/cproton.i 
b/proton-c/bindings/python/cproton.i
index 734069f..6fb213c 100644
--- a/proton-c/bindings/python/cproton.i
+++ b/proton-c/bindings/python/cproton.i
@@ -94,6 +94,7 @@ PN_HANDLE(PNI_PYTRACER);
 
 
 // These are not used/needed in the python binding
+%ignore pn_dtag;
 %ignore pn_message_get_id;
 %ignore pn_message_set_id;
 %ignore pn_message_get_correlation_id;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/13150e49/proton-c/include/proton/delivery.h
----------------------------------------------------------------------
diff --git a/proton-c/include/proton/delivery.h 
b/proton-c/include/proton/delivery.h
index 2f7f965..2642bd7 100644
--- a/proton-c/include/proton/delivery.h
+++ b/proton-c/include/proton/delivery.h
@@ -46,7 +46,6 @@ extern "C" {
  */
 typedef pn_bytes_t pn_delivery_tag_t;
 
-#ifndef SWIG  // older versions of SWIG choke on this:
 /**
  * Construct a delivery tag.
  *
@@ -54,11 +53,7 @@ typedef pn_bytes_t pn_delivery_tag_t;
  * @param[in] size the size of the tag
  * @return the delivery tag
  */
-static inline pn_delivery_tag_t pn_dtag(const char *bytes, size_t size) {
-  pn_delivery_tag_t dtag = {size, bytes};
-  return dtag;
-}
-#endif
+PN_EXTERN pn_delivery_tag_t pn_dtag(const char *bytes, size_t size);
 
 /**
  * Create a delivery on a link.

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/13150e49/proton-c/src/engine/engine.c
----------------------------------------------------------------------
diff --git a/proton-c/src/engine/engine.c b/proton-c/src/engine/engine.c
index 7f99b64..c620101 100644
--- a/proton-c/src/engine/engine.c
+++ b/proton-c/src/engine/engine.c
@@ -1490,6 +1490,11 @@ static void pn_disposition_clear(pn_disposition_t *ds)
 #define pn_delivery_compare NULL
 #define pn_delivery_inspect NULL
 
+pn_delivery_tag_t pn_dtag(const char *bytes, size_t size) {
+  pn_delivery_tag_t dtag = {size, bytes};
+  return dtag;
+}
+
 pn_delivery_t *pn_delivery(pn_link_t *link, pn_delivery_tag_t tag)
 {
   assert(link);


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to