You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by ac...@apache.org on 2015/11/10 15:58:02 UTC

qpid-proton git commit: PROTON-949: fix proton build with ccache swig

Repository: qpid-proton
Updated Branches:
  refs/heads/0.11.x 88f5129f7 -> e17c4abf2


PROTON-949: fix proton build with ccache swig

Moved macro calls and preprocessor directives out of %inline sections, seems to fix the problem.

NOTE: According to ccache-swig man page: "Known problems are using
preprocessor directives within %inline blocks and the use of ’#pragma SWIG’."
This includes using any macros in an %inline section.


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

Branch: refs/heads/0.11.x
Commit: e17c4abf20db1a50620973821022561f6dfb44f9
Parents: 88f5129
Author: Alan Conway <ac...@redhat.com>
Authored: Tue Nov 3 10:12:40 2015 -0500
Committer: Alan Conway <ac...@redhat.com>
Committed: Tue Nov 10 09:56:48 2015 -0500

----------------------------------------------------------------------
 proton-c/bindings/python/cproton.i | 13 +++++-
 proton-c/bindings/ruby/ruby.i      | 75 +++++++++++++++++++--------------
 2 files changed, 54 insertions(+), 34 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e17c4abf/proton-c/bindings/python/cproton.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/python/cproton.i b/proton-c/bindings/python/cproton.i
index 0ead44d..f7f56e3 100644
--- a/proton-c/bindings/python/cproton.i
+++ b/proton-c/bindings/python/cproton.i
@@ -25,11 +25,22 @@
 #include <proton/engine.h>
 #include <proton/url.h>
 #include <proton/message.h>
+#include <proton/object.h>
 #include <proton/sasl.h>
 #include <proton/messenger.h>
 #include <proton/ssl.h>
 #include <proton/reactor.h>
 #include <proton/handlers.h>
+
+/*
+NOTE: According to ccache-swig man page: "Known problems are using
+preprocessor directives within %inline blocks and the use of ’#pragma SWIG’."
+This includes using macros in an %inline section.
+
+Do any preprocessor work or macro expansions here before we get into the %inline sections.
+*/
+PN_HANDLE(PNI_PYTRACER);
+
 %}
 
 %include <cstring.i>
@@ -354,8 +365,6 @@ bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZ
     return chandler;
   }
 
-  PN_HANDLE(PNI_PYTRACER);
-
   void pn_pytracer(pn_transport_t *transport, const char *message) {
     PyObject *pytracer = (PyObject *) pn_record_get(pn_transport_attachments(transport), PNI_PYTRACER);
     SWIG_PYTHON_THREAD_BEGIN_BLOCK;

http://git-wip-us.apache.org/repos/asf/qpid-proton/blob/e17c4abf/proton-c/bindings/ruby/ruby.i
----------------------------------------------------------------------
diff --git a/proton-c/bindings/ruby/ruby.i b/proton-c/bindings/ruby/ruby.i
index dbbd719..eddd529 100644
--- a/proton-c/bindings/ruby/ruby.i
+++ b/proton-c/bindings/ruby/ruby.i
@@ -28,6 +28,47 @@
 #include <proton/url.h>
 #include <proton/reactor.h>
 #include <proton/handlers.h>
+
+
+/*
+NOTE: According to ccache-swig man page: "Known problems are using
+preprocessor directives within %inline blocks and the use of ’#pragma SWIG’."
+This includes using any macros in an %inline section.
+
+Do any preprocessor work or macro expansions here before we get into the %inline sections.
+*/
+
+#define CID_Pn_rbkey CID_pn_void
+
+typedef struct {
+  void *registry;
+  char *method;
+  char *key_value;
+} Pn_rbkey_t;
+
+void Pn_rbkey_initialize(Pn_rbkey_t *rbkey) {
+  assert(rbkey);
+  rbkey->registry = NULL;
+  rbkey->method = NULL;
+  rbkey->key_value = NULL;
+}
+
+void Pn_rbkey_finalize(Pn_rbkey_t *rbkey) {
+  if(rbkey && rbkey->registry && rbkey->method && rbkey->key_value) {
+    rb_funcall((VALUE )rbkey->registry, rb_intern(rbkey->method), 1, rb_str_new2(rbkey->key_value));
+  }
+  if(rbkey->key_value) {
+    free(rbkey->key_value);
+    rbkey->key_value = NULL;
+  }
+}
+
+#define Pn_rbkey_inspect NULL
+#define Pn_rbkey_compare NULL
+#define Pn_rbkey_hashcode NULL
+
+PN_CLASSDEF(Pn_rbkey)
+
 %}
 
 %include <cstring.i>
@@ -465,37 +506,6 @@ bool pn_ssl_get_protocol_name(pn_ssl_t *ssl, char *OUTPUT, size_t MAX_OUTPUT_SIZ
 
 %inline %{
 
-#define CID_Pn_rbkey CID_pn_void
-
-typedef struct {
-  void *registry;
-  char *method;
-  char *key_value;
-} Pn_rbkey_t;
-
-void Pn_rbkey_initialize(Pn_rbkey_t *rbkey) {
-  assert(rbkey);
-  rbkey->registry = NULL;
-  rbkey->method = NULL;
-  rbkey->key_value = NULL;
-}
-
-void Pn_rbkey_finalize(Pn_rbkey_t *rbkey) {
-  if(rbkey && rbkey->registry && rbkey->method && rbkey->key_value) {
-    rb_funcall((VALUE )rbkey->registry, rb_intern(rbkey->method), 1, rb_str_new2(rbkey->key_value));
-  }
-  if(rbkey->key_value) {
-    free(rbkey->key_value);
-    rbkey->key_value = NULL;
-  }
-}
-
-#define Pn_rbkey_inspect NULL
-#define Pn_rbkey_compare NULL
-#define Pn_rbkey_hashcode NULL
-
-PN_CLASSDEF(Pn_rbkey)
-
 void Pn_rbkey_set_registry(Pn_rbkey_t *rbkey, void *registry) {
   assert(rbkey);
   rbkey->registry = registry;
@@ -569,7 +579,8 @@ int pn_ssl_get_peer_hostname(pn_ssl_t *ssl, char *OUTPUT, size_t *OUTPUT_SIZE);
   }
 
   VALUE pni_ruby_get_from_registry(VALUE key) {
-    rb_funcall(pni_ruby_get_proton_module(), rb_intern("get_from_registry"), 1, key);
+
+      return rb_funcall(pni_ruby_get_proton_module(), rb_intern("get_from_registry"), 1, key);
   }
 
   void pni_ruby_delete_from_registry(VALUE stored_key) {


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@qpid.apache.org
For additional commands, e-mail: commits-help@qpid.apache.org