From aac2b5d2e16bba3866b6643473f68a7a82d91594 Mon Sep 17 00:00:00 2001
From: William S Fulton
+%feature("compactdefaultargs") execlp;
+%varargs(3, char *str = NULL) execlp;
+%typemap(in, numinputs=0) char *str3 ""
+...
+int execlp(const char *path, const char *arg, ...);
+
++Note that str3 is the name of the last argument, as we have used %vargars with 3. +Now execlp("a", "b", "c", "d", "e") will result in an error as one too many arguments has been passed, +as now only 2 additional 'str' arguments can be passed with the 3rd one always using the specified default NULL.
diff --git a/Lib/swig.swg b/Lib/swig.swg index e7c01823e..a6fef0257 100644 --- a/Lib/swig.swg +++ b/Lib/swig.swg @@ -500,12 +500,6 @@ namespace std { } } -/* Typemap for variable length arguments sentinel value. Used - by the %varargs directive. */ - -%typemap(in,numinputs=0) SWIGTYPE *VARARGS_SENTINEL, SWIGTYPE VARARGS_SENTINEL ""; - - /* ----------------------------------------------------------------------------- * Overloading support * ----------------------------------------------------------------------------- */ diff --git a/Lib/typemaps/swigtype.swg b/Lib/typemaps/swigtype.swg index bd113e278..47baabf52 100644 --- a/Lib/typemaps/swigtype.swg +++ b/Lib/typemaps/swigtype.swg @@ -559,11 +559,6 @@ * --- Special typemaps --- * ------------------------------------------------------------ */ -/* VARARGS_SENTINEL typemap. Used by the %varargs directive. */ - -%typemap(in,numinputs=0) SWIGTYPE *VARARGS_SENTINEL, SWIGTYPE VARARGS_SENTINEL ""; - - /* DISOWN typemap */ %typemap(in, noblock=1) SWIGTYPE *DISOWN (int res = 0) {