Merge pull request #1473 from ZackerySpytz/OCaml-wrapmacro-test

[OCaml] Fix the wrapmacro test
This commit is contained in:
William S Fulton 2019-02-18 19:33:22 +00:00 • committed by GitHub
commit f19882ed51
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 58 additions and 10 deletions

View file

@ -7,6 +7,7 @@
%include <std/std_except.i>
%apply size_t { std::size_t };
%apply const size_t& { const std::size_t& };
%{
#include <string>

View file

@ -72,7 +72,8 @@
long, signed long, unsigned long,
long long, signed long long, unsigned long long,
const long &, const signed long &, const unsigned long &,
const long long &, const signed long long &, const unsigned long long &
const long long &, const signed long long &, const unsigned long long &,
size_t, const size_t &
{
if( !Is_block($input) ) $1 = 0;
else {

View file

@ -132,11 +132,11 @@
%typemap(varin) C_NAME {
$1 = OCAML_TO_C($input);
}
%typemap(in) C_NAME & ($*1_ltype temp) {
%typemap(in) const C_NAME & ($*1_ltype temp) {
temp = ($*1_ltype) OCAML_TO_C($input);
$1 = &temp;
}
%typemap(varin) C_NAME & {
%typemap(varin) const C_NAME & {
$1 = OCAML_TO_C($input);
}
%typemap(directorout) C_NAME {
@ -156,13 +156,13 @@
%typemap(varout) C_NAME {
$result = C_TO_OCAML($1);
}
%typemap(varout) C_NAME & {
%typemap(varout) const C_NAME & {
$result = C_TO_OCAML($1);
}
%typemap(argout) C_NAME *OUTPUT {
swig_result = caml_list_append(swig_result, C_TO_OCAML((long)*$1));
}
%typemap(out) C_NAME & {
%typemap(out) const C_NAME & {
$result = C_TO_OCAML(*$1);
}
%typemap(directorin) C_NAME {