summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authordgp <dgp@users.sourceforge.net>2005-09-13 21:23:51 (GMT)
committerdgp <dgp@users.sourceforge.net>2005-09-13 21:23:51 (GMT)
commitc483a47557d64385bc3cc9f65aedf8b6bf387843 (patch)
tree4ec0eea5f561d67d221ac1cac6c7ccde0cf4c8e9 /generic/tcl.h
parent0f676d700286952cb2db293c6dd1320dd31e7fe9 (diff)
downloadtcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.zip
tcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.tar.gz
tcl-c483a47557d64385bc3cc9f65aedf8b6bf387843.tar.bz2
* generic/tcl.h: Explicitly standardized on the use of stdarg.h
* generic/tclBasic.c: conventions for functions with variable number * generic/tclInt.h: of arguments. Support for varargs.h has been * generic/tclPanic.c: implicitly gone for some time now. All * generic/tclResult.c: TCL_VARARGS* macros purged from Tcl sources, * generic/tclStringObj.c: leaving only some deprecated #define's * tools/genStubs.tcl: in tcl.h for the sake of older extensions. * generic/tclDecls.h: make genstubs * doc/AddErrInfo.3: Replaced all documented requirement for use * doc/Eval.3: of TCL_VARARGS_START() with requirement for * doc/Panic.3: use of va_start(). * doc/SetResult.3: * doc/StringObj.3:
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h34
1 files changed, 14 insertions, 20 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index ff80a84..f75ae6f 100644
--- a/generic/tcl.h
+++ b/generic/tcl.h
@@ -13,7 +13,7 @@
* See the file "license.terms" for information on usage and redistribution of
* this file, and for a DISCLAIMER OF ALL WARRANTIES.
*
- * RCS: @(#) $Id: tcl.h,v 1.202 2005/09/08 10:49:19 dkf Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.203 2005/09/13 21:23:51 dgp Exp $
*/
#ifndef _TCL
@@ -153,26 +153,20 @@ extern "C" {
#include <stdio.h>
/*
- * Definitions that allow Tcl functions with variable numbers of arguments to
- * be used with either varargs.h or stdarg.h. TCL_VARARGS is used in function
- * prototypes. TCL_VARARGS_DEF is used to declare the arguments in a function
- * definiton: it takes the type and name of the first argument and supplies
- * the appropriate argument declaration string for use in the function
- * definition. TCL_VARARGS_START initializes the va_list data structure and
- * returns the first argument.
+ * Support for functions with a variable number of arguments.
+ *
+ * The following TCL_VARARGS* macros are to support old extensions
+ * written for older versions of Tcl where the macros permitted
+ * support for the varargs.h system as well as stdarg.h .
+ *
+ * New code should just directly be written to use stdarg.h conventions.
*/
-#if !defined(NO_STDARG)
-# include <stdarg.h>
-# define TCL_VARARGS(type, name) (type name, ...)
-# define TCL_VARARGS_DEF(type, name) (type name, ...)
-# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
-#else
-# include <varargs.h>
-# define TCL_VARARGS(type, name) ()
-# define TCL_VARARGS_DEF(type, name) (va_alist)
-# define TCL_VARARGS_START(type, name, list) \
- (va_start(list), va_arg(list, type))
+#include <stdarg.h>
+#ifndef TCL_NO_DEPRECATED
+# define TCL_VARARGS(type, name) (type name, ...)
+# define TCL_VARARGS_DEF(type, name) (type name, ...)
+# define TCL_VARARGS_START(type, name, list) (va_start(list, name), name)
#endif
/*
@@ -694,7 +688,7 @@ typedef int (Tcl_ObjCmdProc) _ANSI_ARGS_((ClientData clientData,
typedef int (Tcl_PackageInitProc) _ANSI_ARGS_((Tcl_Interp *interp));
typedef int (Tcl_PackageUnloadProc) _ANSI_ARGS_((Tcl_Interp *interp,
int flags));
-typedef void (Tcl_PanicProc) _ANSI_ARGS_(TCL_VARARGS(CONST char *, format));
+typedef void (Tcl_PanicProc) _ANSI_ARGS_((CONST char *format, ...));
typedef void (Tcl_TcpAcceptProc) _ANSI_ARGS_((ClientData callbackData,
Tcl_Channel chan, char *address, int port));
typedef void (Tcl_TimerProc) _ANSI_ARGS_((ClientData clientData));