You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@qpid.apache.org by rg...@apache.org on 2013/02/02 15:47:09 UTC

svn commit: r1441759 - /qpid/proton/trunk/proton-c/bindings/java/java.i

Author: rgodfrey
Date: Sat Feb  2 14:47:09 2013
New Revision: 1441759

URL: http://svn.apache.org/viewvc?rev=1441759&view=rev
Log:
PROTON-192 : Modify java.i file to allow for building on older versions of SWIG

Modified:
    qpid/proton/trunk/proton-c/bindings/java/java.i

Modified: qpid/proton/trunk/proton-c/bindings/java/java.i
URL: http://svn.apache.org/viewvc/qpid/proton/trunk/proton-c/bindings/java/java.i?rev=1441759&r1=1441758&r2=1441759&view=diff
==============================================================================
--- qpid/proton/trunk/proton-c/bindings/java/java.i (original)
+++ qpid/proton/trunk/proton-c/bindings/java/java.i Sat Feb  2 14:47:09 2013
@@ -34,8 +34,23 @@
 #include <proton/messenger.h>
 
 %}
+/* SWIG 1.x does not include the following necessary typemaps */
+#if (SWIG_VERSION  >> 16) < 2
+%typemap(jni)     (char *STRING, size_t LENGTH) "jbyteArray"
+%typemap(jtype)   (char *STRING, size_t LENGTH) "byte[]"
+%typemap(jstype)  (char *STRING, size_t LENGTH) "byte[]"
+%typemap(javain)  (char *STRING, size_t LENGTH) "$javainput"
+%typemap(freearg) (char *STRING, size_t LENGTH) ""
+%typemap(in)      (char *STRING, size_t LENGTH) {
+    $1 = (char *) JCALL2(GetByteArrayElements, jenv, $input, 0);
+    $2 = (size_t) JCALL1(GetArrayLength,       jenv, $input);
+}
+%typemap(argout)  (char *STRING, size_t LENGTH) {
+    JCALL3(ReleaseByteArrayElements, jenv, $input, (jbyte *)$1, 0);
+}
+%apply (char *STRING, size_t LENGTH) { (char *STRING, int LENGTH) }
 
-
+#endif
 %typemap(in) (char *DATA, size_t SIZE) (char *data, jobject arr, jboolean isDirect) {
   /* %typemap(in) void * */
   jclass bbclass = JCALL1(GetObjectClass,jenv, $input);



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