X-Git-Url: https://git.openafs.org/?p=openafs.git;a=blobdiff_plain;f=src%2Flibuafs%2Fukernel_swig.i;h=94fc6d4df8ae6666ed0677bd89211e2f93ea82a9;hp=bf6ce41853d430cce885426f113f3215d1d969ca;hb=dd97cb7a7447313dbc1da65104786fe03ede7c8d;hpb=3505c444f681c8bfed3638b7393f3f40449492b5 diff --git a/src/libuafs/ukernel_swig.i b/src/libuafs/ukernel_swig.i index bf6ce41..94fc6d4 100644 --- a/src/libuafs/ukernel_swig.i +++ b/src/libuafs/ukernel_swig.i @@ -16,8 +16,8 @@ * For each language you want a binding for, there are two typemaps you * must define for that language, since SWIG does not handle them natively. * These are the 'in' typemap for READBUF and LENGTH, and the 'argout' - * typemap for READBUF. Search this file for 'perl5' to see existing ones - * for the Perl 5 bindings. + * typemap for READBUF. Search this file for 'SWIGPERL' to see existing ones + * for the Perl bindings. */ %module "AFS::ukernel" @@ -78,14 +78,15 @@ extern int uafs_Run(void); * (Reading in a binary buffer from e.g. uafs_write is already handled natively * by SWIG. Fancy that.) */ -%typemap(in, numinputs=1, perl5) (char *READBUF, int LENGTH) { +#if defined(SWIGPERL) +%typemap(in, numinputs=1) (char *READBUF, int LENGTH) { if (!SvIOK($input)) { SWIG_croak("expected an integer"); } $2 = SvIV($input); Newx($1, $2, char); } -%typemap(argout, numinputs=1, perl5) char *READBUF { +%typemap(argout, numinputs=1) char *READBUF { /* some logic here copied from typemaps.i and/or SWIG itself, since I'm not * a perl dev */ @@ -105,6 +106,9 @@ extern int uafs_Run(void); Safefree($1); argvi++; } +#else +# error No READBUF typemap defined for the given language +#endif extern int uafs_mkdir(char *path, int mode); extern int uafs_chdir(char *path);