Marshalling char[] and char[ANY] to Java byte[] is now a bit easier

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@12742 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2011-06-17 06:41:53 +00:00
commit 8a6e006a7b
3 changed files with 27 additions and 5 deletions

View file

@ -8,6 +8,7 @@
JAVA_ARRAYSOFCLASSES(SimpleStruct)
%apply ARRAYSOFENUMS[ANY] { finger[ANY] }
//%apply signed char[ANY] { char array_c2[ANY] }
%include "arrays.i"
@ -54,3 +55,15 @@ typedef enum { Big, Little } toe;
void toestest(toe *t, toe tt[], toe ttt[2]) {}
%}
JAVA_ARRAYS_IMPL(char, jbyte, Byte, Char)
JAVA_ARRAYS_TYPEMAPS(char, byte, jbyte, Char, "[B")
%typecheck(SWIG_TYPECHECK_INT8_ARRAY) /* Java byte[] */
signed char[ANY], signed char[]
""
%inline %{
struct ArrayStructExtra {
char array_c2[ARRAY_LEN];
};
%}