Tcl Source Code

Artifact [cf434532b1]
Login

Artifact cf434532b19abb52871f627a621991e5e9b0ec4c:

Attachment "tcl.h.patch" to ticket [565088ffff] added by jenglish 2002-06-08 08:27:35.
Index: tcl.h
===================================================================
RCS file: /cvsroot/tcl/tcl/generic/tcl.h,v
retrieving revision 1.124
diff -c -r1.124 tcl.h
*** tcl.h	24 May 2002 21:19:05 -0000	1.124
--- tcl.h	8 Jun 2002 01:25:18 -0000
***************
*** 79,98 ****
  #   endif
  #endif
  
  #ifdef __WIN32__
  #   ifndef STRICT
  #	define STRICT
  #   endif
- #   ifndef USE_PROTOTYPE
- #	define USE_PROTOTYPE 1
- #   endif
- #   ifndef HAS_STDARG
- #	define HAS_STDARG 1
- #   endif
- #   ifndef USE_PROTOTYPE
- #	define USE_PROTOTYPE 1
- #   endif
- 
  #endif /* __WIN32__ */
  
  /*
--- 79,91 ----
  #   endif
  #endif
  
+ /*
+  * STRICT: See MSDN Article Q83456
+  */
  #ifdef __WIN32__
  #   ifndef STRICT
  #	define STRICT
  #   endif
  #endif /* __WIN32__ */
  
  /*
***************
*** 102,110 ****
  
  #ifdef MAC_TCL
  #include <ConditionalMacros.h>
- #   ifndef HAS_STDARG
- #	define HAS_STDARG 1
- #   endif
  #   ifndef USE_TCLALLOC
  #	define USE_TCLALLOC 1
  #   endif
--- 95,100 ----
***************
*** 114,145 ****
  #   define INLINE 
  #endif
  
  /*
   * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
   * quotation marks), JOIN joins two arguments.
   */
! 
! #define VERBATIM(x) x
! #ifdef _MSC_VER
! # define STRINGIFY(x) STRINGIFY1(x)
! # define STRINGIFY1(x) #x
! # define JOIN(a,b) JOIN1(a,b)
! # define JOIN1(a,b) a##b
! #else
! # ifdef RESOURCE_INCLUDED
  #  define STRINGIFY(x) STRINGIFY1(x)
  #  define STRINGIFY1(x) #x
  #  define JOIN(a,b) JOIN1(a,b)
  #  define JOIN1(a,b) a##b
- # else
- #  ifdef __STDC__
- #   define STRINGIFY(x) #x
- #   define JOIN(a,b) a##b
- #  else
- #   define STRINGIFY(x) "x"
- #   define JOIN(a,b) VERBATIM(a)VERBATIM(b)
- #  endif
- # endif
  #endif
  
  /*
--- 104,121 ----
  #   define INLINE 
  #endif
  
+ 
  /*
   * Utility macros: STRINGIFY takes an argument and wraps it in "" (double
   * quotation marks), JOIN joins two arguments.
   */
! #ifndef STRINGIFY
  #  define STRINGIFY(x) STRINGIFY1(x)
  #  define STRINGIFY1(x) #x
+ #endif
+ #ifndef JOIN
  #  define JOIN(a,b) JOIN1(a,b)
  #  define JOIN1(a,b) a##b
  #endif
  
  /*
***************
*** 190,214 ****
   * string for use in the function definition.  TCL_VARARGS_START
   * initializes the va_list data structure and returns the first argument.
   */
! #if defined(__STDC__) || defined(HAS_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>
- #   ifdef __cplusplus
- #      define TCL_VARARGS(type, name) (type name, ...)
- #      define TCL_VARARGS_DEF(type, name) (type va_alist, ...)
- #   else
  #      define TCL_VARARGS(type, name) ()
  #      define TCL_VARARGS_DEF(type, name) (va_alist)
- #   endif
  #   define TCL_VARARGS_START(type, name, list) \
  	(va_start(list), va_arg(list, type))
  #endif
  
- 
  /*
   * Macros used to declare a function to be exported by a DLL.
   * Used by Windows, maps to no-op declarations on non-Windows systems.
--- 166,184 ----
   * string for use in the function definition.  TCL_VARARGS_START
   * initializes the va_list data structure and returns the first argument.
   */
! #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))
  #endif
  
  /*
   * Macros used to declare a function to be exported by a DLL.
   * Used by Windows, maps to no-op declarations on non-Windows systems.
***************
*** 267,281 ****
  #   define INLINE
  #endif
  
! #if ((defined(__STDC__) || defined(SABER)) && !defined(NO_PROTOTYPE)) || defined(__cplusplus) || defined(USE_PROTOTYPE)
! #   define _USING_PROTOTYPES_ 1
! #   define _ANSI_ARGS_(x)	x
  #   define CONST const
  #else
- #   define _ANSI_ARGS_(x)	()
  #   define CONST
  #endif
  
  #ifdef USE_NON_CONST
  #   define CONST84
  #else
--- 237,254 ----
  #   define INLINE
  #endif
  
! #ifndef NO_CONST
  #   define CONST const
  #else
  #   define CONST
  #endif
  
+ #ifndef NO_PROTOTYPES
+ #   define _ANSI_ARGS_(x)	x
+ #else
+ #   define _ANSI_ARGS_(x)	()
+ #endif
+ 
  #ifdef USE_NON_CONST
  #   define CONST84
  #else
***************
*** 298,327 ****
  
  
  /*
!  * Macro to use instead of "void" for arguments that must have
!  * type "void *" in ANSI C;  maps them to type "char *" in
!  * non-ANSI systems.
!  */
! #ifndef __WIN32__
! #   ifndef VOID
! #      ifdef __STDC__
! #         define VOID void
! #      else
! #         define VOID char
! #      endif
! #   endif
! #else /* __WIN32__ */
! /*
!  * The following code is copied from winnt.h
   */
! #   ifndef VOID
! #      define VOID void
  typedef char CHAR;
  typedef short SHORT;
  typedef long LONG;
! #   endif
  #endif /* __WIN32__ */
  
  
  /*
   * Miscellaneous declarations.
--- 271,300 ----
  
  
  /*
!  * The following code is copied from winnt.h.
!  * If we don't replicate it here, then <windows.h> can't be included 
!  * after tcl.h, since tcl.h also defines VOID.
   */
! #ifdef __WIN32__
! #ifndef VOID
! #define VOID void
  typedef char CHAR;
  typedef short SHORT;
  typedef long LONG;
! #endif
  #endif /* __WIN32__ */
  
+ /*
+  * Macro to use instead of "void" for arguments that must have
+  * type "void *" in ANSI C;  maps them to type "char *" in
+  * non-ANSI systems.
+  */
+ 
+ #ifndef NO_VOID
+ #         define VOID void
+ #else
+ #         define VOID char
+ #endif
  
  /*
   * Miscellaneous declarations.
***************
*** 331,345 ****
  #endif
  
  #ifndef _CLIENTDATA
! #   if defined(__STDC__) || defined(__cplusplus) || defined(__BORLANDC__)
! typedef void *ClientData;
  #   else
! typedef int *ClientData;
! #   endif /* __STDC__ */
  #   define _CLIENTDATA
  #endif
  
- 
  /*
   * Define Tcl_WideInt to be a type that is (at least) 64-bits wide,
   * and define Tcl_WideUInt to be the unsigned variant of that type
--- 304,317 ----
  #endif
  
  #ifndef _CLIENTDATA
! #   ifndef NO_VOID
! 	typedef void *ClientData;
  #   else
! 	typedef int *ClientData;
! #   endif
  #   define _CLIENTDATA
  #endif
  
  /*
   * Define Tcl_WideInt to be a type that is (at least) 64-bits wide,
   * and define Tcl_WideUInt to be the unsigned variant of that type
***************
*** 366,371 ****
--- 338,344 ----
   * backwards) so any changes you make will need to be done
   * cautiously...
   */
+ 
  #if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
  #   ifdef __WIN32__
  #      define TCL_WIDE_INT_TYPE __int64
***************
*** 404,412 ****
  typedef unsigned TCL_WIDE_INT_TYPE	Tcl_WideUInt;
  
  #ifdef TCL_WIDE_INT_IS_LONG
- #   ifndef MAC_TCL
- #   include <sys/types.h>
- #   endif
  typedef struct stat	Tcl_StatBuf;
  #   define Tcl_WideAsLong(val)		((long)(val))
  #   define Tcl_LongAsWide(val)		((long)(val))
--- 377,382 ----
***************
*** 414,422 ****
  #   define Tcl_DoubleAsWide(val)	((long)((double)(val)))
  #else /* TCL_WIDE_INT_IS_LONG */
  #   ifndef __WIN32__
- #      ifndef MAC_TCL
- #      include <sys/types.h>
- #      endif
  #      ifdef HAVE_STRUCT_STAT64
  typedef struct stat64	Tcl_StatBuf;
  #      else
--- 384,389 ----