diff --git a/Examples/test-suite/c/Makefile.in b/Examples/test-suite/c/Makefile.in index c3175ae5d..b4b80a2d3 100644 --- a/Examples/test-suite/c/Makefile.in +++ b/Examples/test-suite/c/Makefile.in @@ -33,7 +33,6 @@ FAILING_C_TESTS := \ function_typedef \ lextype \ li_carrays \ - li_cdata \ li_cpointer \ nested \ nested_extend_c \ diff --git a/Lib/cdata.i b/Lib/cdata.i index b9b8e1887..23e552cf9 100644 --- a/Lib/cdata.i +++ b/Lib/cdata.i @@ -21,6 +21,28 @@ typedef struct SWIGCDATA { } %typemap(in) (const void *indata, int inlen) = (char *STRING, int LENGTH); +#elif SWIGC + +%insert("cheader") { +typedef struct SWIGCDATA { + char *data; + int len; +} SWIGCDATA; +} + +%typemap(ctype) SWIGCDATA "SWIGCDATA" +%typemap(cppouttype) SWIGCDATA "SWIGCDATA" + +%typemap(out) SWIGCDATA { + $result = $1; +} + +%typemap(ctype) (const void *indata, int inlen) "const SWIGCDATA*" +%typemap(in) (const void *indata, int inlen) { + $1 = $input->data; + $2 = $input->len; +} + #elif SWIGCHICKEN %typemap(out) SWIGCDATA {