#ifdef __GNUC__ -> static inline to remove warning spew using gcc typemaps: tweaks for arrays, enums ocaml.cxx: remove Swig. qualifier everywhere it's not needed git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk@6655 626c5289-ae23-0410-ae9c-e8d60b6d4f22
43 lines
1,001 B
C
43 lines
1,001 B
C
/* SWIG Configuration File for Ocaml. -*-c-*-
|
|
Modified from mzscheme.i
|
|
This file is parsed by SWIG before reading any other interface
|
|
file. */
|
|
|
|
/* Insert common stuff */
|
|
%insert(runtime) "common.swg"
|
|
|
|
/* Include headers */
|
|
%insert(runtime) "ocamldec.swg"
|
|
|
|
/* Type registration */
|
|
%insert(init) "typeregister.swg"
|
|
|
|
%insert(mlitail) %{
|
|
val swig_val : c_enum_type -> c_obj -> Swig.c_obj
|
|
%}
|
|
|
|
%insert(mltail) %{
|
|
let rec swig_val t v =
|
|
match v with
|
|
C_enum e -> enum_to_int t v
|
|
| C_list l -> Swig.C_list (List.map (swig_val t) l)
|
|
| C_array a -> Swig.C_array (Array.map (swig_val t) a)
|
|
| _ -> Obj.magic v
|
|
%}
|
|
|
|
/*#ifndef SWIG_NOINCLUDE*/
|
|
%insert(runtime) "ocaml.swg"
|
|
/*#endif*/
|
|
|
|
%insert(classtemplate) "class.swg"
|
|
|
|
/* Definitions */
|
|
#define SWIG_malloc(size) swig_malloc(size, FUNC_NAME)
|
|
#define SWIG_free(mem) free(mem)
|
|
|
|
/* Read in standard typemaps. */
|
|
%include "swig.swg"
|
|
%include "typemaps.i"
|
|
%include "typecheck.i"
|
|
%include "exception.i"
|
|
%include "preamble.swg"
|