Proper handling of arrays finally in the works, no special typemaps needed.
Some corrections for use with -small. git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@4420 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
parent
6f640c1b45
commit
47d747477f
4 changed files with 25 additions and 42 deletions
|
|
@ -19,18 +19,4 @@ private:
|
|||
int owned;
|
||||
};
|
||||
|
||||
%typemap(ocaml,out) SWIGTYPE [ANY] {
|
||||
$result = new SWIG_OCAML_ARRAY_WRAPPER($1);
|
||||
}
|
||||
|
||||
%typemap(ocaml,varout) SWIGTYPE [ANY] {
|
||||
$result = new SWIG_OCAML_ARRAY_WRAPPER($1);
|
||||
}
|
||||
|
||||
%typemap(ocaml,in) SWIGTYPE [ANY] {
|
||||
$1 = (SWIG_OCAML_ARRAY_WRAPPER<$ltype> *)$input;
|
||||
}
|
||||
|
||||
%typemap(ocaml,varin) SWIGTYPE [ANY] {
|
||||
$1 = (SWIG_OCAML_ARRAY_WRAPPER<$ltype> *)$input;
|
||||
}
|
||||
%apply SWIGTYPE [ANY] {SWIG_OCAML_ARRAY_WRAPPER};
|
||||
|
|
|
|||
|
|
@ -11,7 +11,10 @@
|
|||
#include <stdlib.h>
|
||||
|
||||
#ifdef __cplusplus
|
||||
extern "C" {
|
||||
#define SWIGEXT extern "C"
|
||||
SWIGEXT {
|
||||
#else
|
||||
#define SWIGEXT
|
||||
#endif
|
||||
#define alloc caml_alloc
|
||||
#include <caml/alloc.h>
|
||||
|
|
|
|||
|
|
@ -160,12 +160,18 @@
|
|||
%typemap(varin) C_NAME {
|
||||
$1 = MZ_TO_C($input);
|
||||
}
|
||||
%typemap(memberin) C_NAME {
|
||||
$1 = MZ_TO_C($input);
|
||||
}
|
||||
%typemap(out) C_NAME {
|
||||
$result = C_TO_MZ($1);
|
||||
}
|
||||
%typemap(varout) C_NAME {
|
||||
$result = C_TO_MZ($1);
|
||||
}
|
||||
%typemap(memberout) C_NAME {
|
||||
$resunt = C_TO_MZ($1);
|
||||
}
|
||||
%typemap(in) C_NAME *INPUT (C_NAME temp) {
|
||||
temp = (C_NAME) MZ_TO_C($input);
|
||||
$1 = &temp;
|
||||
|
|
@ -185,8 +191,8 @@
|
|||
}
|
||||
%enddef
|
||||
|
||||
SIMPLE_MAP(oc_bool, caml_val_bool, caml_long_val);
|
||||
SIMPLE_MAP(bool, caml_val_bool, caml_long_val);
|
||||
SIMPLE_MAP(oc_bool, caml_val_bool, caml_long_val);
|
||||
SIMPLE_MAP(char, caml_val_char, caml_long_val);
|
||||
SIMPLE_MAP(unsigned char, caml_val_uchar, caml_long_val);
|
||||
SIMPLE_MAP(int, caml_val_int, caml_long_val);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue