diff --git a/SWIG/Lib/guile/typemaps.i b/SWIG/Lib/guile/typemaps.i index 89e86ed06..fe6da0060 100644 --- a/SWIG/Lib/guile/typemaps.i +++ b/SWIG/Lib/guile/typemaps.i @@ -5,28 +5,38 @@ #define MK_SIMPLE_MAP(f) $target = f ($source) -%typemap (guile, in) bool { MK_SIMPLE_MAP (gh_scm2bool); } -%typemap (guile, in) char { MK_SIMPLE_MAP (gh_scm2char); } -%typemap (guile, in) int { MK_SIMPLE_MAP (gh_scm2int); } -%typemap (guile, in) short { MK_SIMPLE_MAP (gh_scm2int); } -%typemap (guile, in) long { MK_SIMPLE_MAP (gh_scm2long); } -%typemap (guile, in) unsigned int { MK_SIMPLE_MAP (gh_scm2ulong); } -%typemap (guile, in) unsigned short { MK_SIMPLE_MAP (gh_scm2ulong); } -%typemap (guile, in) unsigned long { MK_SIMPLE_MAP (gh_scm2ulong); } -%typemap (guile, in) float { MK_SIMPLE_MAP (gh_scm2double); } -%typemap (guile, in) double { MK_SIMPLE_MAP (gh_scm2double); } +#define SIMPLE_IN_MAP_SET(op) \ +%typemap (guile, op) bool { MK_SIMPLE_MAP (gh_scm2bool); } \ +%typemap (guile, op) char { MK_SIMPLE_MAP (gh_scm2char); } \ +%typemap (guile, op) int { MK_SIMPLE_MAP (gh_scm2int); } \ +%typemap (guile, op) short { MK_SIMPLE_MAP (gh_scm2int); } \ +%typemap (guile, op) long { MK_SIMPLE_MAP (gh_scm2long); } \ +%typemap (guile, op) unsigned int { MK_SIMPLE_MAP (gh_scm2ulong); } \ +%typemap (guile, op) unsigned short { MK_SIMPLE_MAP (gh_scm2ulong); } \ +%typemap (guile, op) unsigned long { MK_SIMPLE_MAP (gh_scm2ulong); } \ +%typemap (guile, op) float { MK_SIMPLE_MAP (gh_scm2double); } \ +%typemap (guile, op) double { MK_SIMPLE_MAP (gh_scm2double); } -%typemap (guile, out) bool { MK_SIMPLE_MAP (gh_bool2scm); } -%typemap (guile, out) char { MK_SIMPLE_MAP (gh_char2scm); } -%typemap (guile, out) int { MK_SIMPLE_MAP (gh_int2scm); } -%typemap (guile, out) short { MK_SIMPLE_MAP (gh_int2scm); } -%typemap (guile, out) long { MK_SIMPLE_MAP (gh_long2scm); } -%typemap (guile, out) unsigned int { MK_SIMPLE_MAP (gh_ulong2scm); } -%typemap (guile, out) unsigned short { MK_SIMPLE_MAP (gh_ulong2scm); } -%typemap (guile, out) unsigned long { MK_SIMPLE_MAP (gh_ulong2scm); } -%typemap (guile, out) float { MK_SIMPLE_MAP (gh_double2scm); } -%typemap (guile, out) double { MK_SIMPLE_MAP (gh_double2scm); } +#define SIMPLE_OUT_MAP_SET(op) \ +%typemap (guile, op) bool { MK_SIMPLE_MAP (gh_bool2scm); } \ +%typemap (guile, op) char { MK_SIMPLE_MAP (gh_char2scm); } \ +%typemap (guile, op) int { MK_SIMPLE_MAP (gh_int2scm); } \ +%typemap (guile, op) short { MK_SIMPLE_MAP (gh_int2scm); } \ +%typemap (guile, op) long { MK_SIMPLE_MAP (gh_long2scm); } \ +%typemap (guile, op) unsigned int { MK_SIMPLE_MAP (gh_ulong2scm); } \ +%typemap (guile, op) unsigned short { MK_SIMPLE_MAP (gh_ulong2scm); } \ +%typemap (guile, op) unsigned long { MK_SIMPLE_MAP (gh_ulong2scm); } \ +%typemap (guile, op) float { MK_SIMPLE_MAP (gh_double2scm); } \ +%typemap (guile, op) double { MK_SIMPLE_MAP (gh_double2scm); } -#undef MK_SIMPLE_MAP +/* + * Declaration start here + */ + +SIMPLE_IN_MAP_SET (in) +SIMPLE_IN_MAP_SET (varin) + +SIMPLE_OUT_MAP_SET (out) +SIMPLE_OUT_MAP_SET (varout) /* typemaps.i ends here */