mods to use "default" typemap instead of default arguments for new default argument wrapping approach

git-svn-id: https://swig.svn.sourceforge.net/svnroot/swig/trunk/SWIG@6304 626c5289-ae23-0410-ae9c-e8d60b6d4f22
This commit is contained in:
William S Fulton 2004-10-04 20:08:25 +00:00
commit ff38a4e4ef
2 changed files with 16 additions and 9 deletions

View file

@ -34,11 +34,11 @@
#else
%name(malloc_##TYPE)
#endif
TYPE *malloc(int nbytes
#if #TYPE != "void"
= sizeof(TYPE)
%typemap(default) int nbytes "$1 = (int) sizeof(TYPE);"
#endif
);
TYPE *malloc(int nbytes);
%typemap(default) int nbytes;
%enddef
%define %calloc(TYPE,...)
@ -47,13 +47,15 @@ TYPE *malloc(int nbytes
#else
%name(calloc_##TYPE)
#endif
TYPE *calloc(int nobj = 1, int sz =
#if #TYPE != "void"
sizeof(TYPE)
%typemap(default) int sz "$1 = (int) sizeof(TYPE);"
#else
1
%typemap(default) int sz "$1 = 1;"
#endif
);
%typemap(default) int nobj "$1 = 1;"
TYPE *calloc(int nobj, int sz);
%typemap(default) int sz;
%typemap(default) int nobj;
%enddef
%define %realloc(TYPE,...)