diff options
author | dkf <donal.k.fellows@manchester.ac.uk> | 2001-10-18 09:03:58 (GMT) |
---|---|---|
committer | dkf <donal.k.fellows@manchester.ac.uk> | 2001-10-18 09:03:58 (GMT) |
commit | 5b99df7fb39cda162ef9d9f4df5acc875f9f6016 (patch) | |
tree | 086be07d74d5410b312616b802b117bcef0ca6ba | |
parent | b134b7beb27e5ccf73392ae7b9e8b0a04bad05a3 (diff) | |
download | tcl-5b99df7fb39cda162ef9d9f4df5acc875f9f6016.zip tcl-5b99df7fb39cda162ef9d9f4df5acc875f9f6016.tar.gz tcl-5b99df7fb39cda162ef9d9f4df5acc875f9f6016.tar.bz2 |
Various changes to make life much easier on non-UNIX platforms (mostly Win32.)
-rw-r--r-- | compat/strtoull.c | 6 | ||||
-rw-r--r-- | generic/tcl.h | 28 | ||||
-rw-r--r-- | mac/tclMacChan.c | 10 | ||||
-rw-r--r-- | win/Makefile.in | 4 | ||||
-rw-r--r-- | win/makefile.bc | 2 | ||||
-rw-r--r-- | win/makefile.vc | 4 | ||||
-rw-r--r-- | win/tclWinChan.c | 6 | ||||
-rw-r--r-- | win/tclWinPort.h | 9 |
8 files changed, 47 insertions, 22 deletions
diff --git a/compat/strtoull.c b/compat/strtoull.c index 0b9a8fa..dd2d7d6 100644 --- a/compat/strtoull.c +++ b/compat/strtoull.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: strtoull.c,v 1.1.2.1 2001/10/15 10:48:49 dkf Exp $ + * RCS: @(#) $Id: strtoull.c,v 1.1.2.2 2001/10/18 09:03:58 dkf Exp $ */ #include "tcl.h" @@ -52,7 +52,7 @@ static char cvtIn[] = { *---------------------------------------------------------------------- */ -unsigned long long +Tcl_WideUInt strtoull(string, endPtr, base) char *string; /* String of ASCII digits, possibly * preceded by white space. For bases @@ -69,7 +69,7 @@ strtoull(string, endPtr, base) */ { register char *p; - register unsigned long long result = 0; + register Tcl_WideUInt result = 0; register unsigned digit; int anyDigits = 0; diff --git a/generic/tcl.h b/generic/tcl.h index 79f1f40..24daeb7 100644 --- a/generic/tcl.h +++ b/generic/tcl.h @@ -12,7 +12,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.102.2.16 2001/10/17 09:28:16 dkf Exp $ + * RCS: @(#) $Id: tcl.h,v 1.102.2.17 2001/10/18 09:03:59 dkf Exp $ */ #ifndef _TCL @@ -329,7 +329,9 @@ typedef int *ClientData; /* - * Define Tcl_WideInt to be a type that is (at least) 64-bits wide. + * 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 + * (assuming that where we have one, we can have the other.) * * At the moment, this only works on Unix systems anyway... * @@ -359,7 +361,8 @@ typedef int *ClientData; * TCL_PRINTF_SUPPORTS_LL */ #ifdef TCL_WIDE_INT_TYPE -typedef TCL_WIDE_INT_TYPE Tcl_WideInt; +typedef TCL_WIDE_INT_TYPE Tcl_WideInt; +typedef unsigned TCL_WIDE_INT_TYPE Tcl_WideUInt; #else # ifndef TCL_WIDE_INT_IS_LONG # if defined(_LP64)||defined(__ALPHA)||defined(__alpha)||defined(_AIX) @@ -370,13 +373,17 @@ typedef TCL_WIDE_INT_TYPE Tcl_WideInt; # define TCL_WIDE_INT_IS_LONG # else # ifdef __WIN32__ -typedef __int64 Tcl_WideInt; +typedef __int64 Tcl_WideInt; +typedef unsigned __int64 Tcl_WideUInt; +# define TCL_WIDE_INT_TYPE __int64 # else /* * Type of 64-bit values on 32-bit systems. I think this is the ISO * C99 standard way of writing this type. */ -typedef long long Tcl_WideInt; +typedef long long Tcl_WideInt; +typedef unsigned long long Tcl_WideUInt; +# define TCL_WIDE_INT_TYPE long long # endif /* __WIN32__ */ # endif /* _LP64 | __ALPHA | __alpha | _AIX */ # endif /* !TCL_WIDE_INT_IS_LONG */ @@ -385,6 +392,7 @@ typedef long long Tcl_WideInt; #ifdef TCL_WIDE_INT_IS_LONG # include <sys/types.h> typedef long Tcl_WideInt; +typedef unsigned long Tcl_WideInt; # ifdef __WIN32__ typedef long Tcl_SeekOffset; # else @@ -398,9 +406,15 @@ typedef struct stat Tcl_StatBuf; #else /* TCL_WIDE_INT_IS_LONG */ # define TCL_PRINTF_SUPPORTS_LL # ifdef __WIN32__ +# ifdef __BORLANDC__ +typedef struct stati64 Tcl_StatBuf; +# define TCL_LL_MODIFIER "L" +# define TCL_LL_MODIFIER_SIZE 1 +# else /* __BORLANDC__ */ typedef struct _stati64 Tcl_StatBuf; -# define TCL_LL_MODIFIER "I64" -# define TCL_LL_MODIFIER_SIZE 3 +# define TCL_LL_MODIFIER "I64" +# define TCL_LL_MODIFIER_SIZE 3 +# endif /* __BORLANDC__ */ # else # include <sys/types.h> # ifdef HAVE_STRUCT_STAT64 diff --git a/mac/tclMacChan.c b/mac/tclMacChan.c index e728c7f..1765fe0 100644 --- a/mac/tclMacChan.c +++ b/mac/tclMacChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclMacChan.c,v 1.7 2001/08/30 08:53:15 vincentdarley Exp $ + * RCS: @(#) $Id: tclMacChan.c,v 1.7.6.1 2001/10/18 09:03:59 dkf Exp $ */ #include "tclInt.h" @@ -109,7 +109,7 @@ static int FileInput _ANSI_ARGS_((ClientData instanceData, char *buf, int toRead, int *errorCode)); static int FileOutput _ANSI_ARGS_((ClientData instanceData, char *buf, int toWrite, int *errorCode)); -static int FileSeek _ANSI_ARGS_((ClientData instanceData, +static Tcl_WideInt FileSeek _ANSI_ARGS_((ClientData instanceData, long offset, int mode, int *errorCode)); static void FileSetupProc _ANSI_ARGS_((ClientData clientData, int flags)); @@ -125,7 +125,7 @@ static int StdIOInput _ANSI_ARGS_((ClientData instanceData, char *buf, int toRead, int *errorCode)); static int StdIOOutput _ANSI_ARGS_((ClientData instanceData, char *buf, int toWrite, int *errorCode)); -static int StdIOSeek _ANSI_ARGS_((ClientData instanceData, +static Tcl_WideInt StdIOSeek _ANSI_ARGS_((ClientData instanceData, long offset, int mode, int *errorCode)); static int StdReady _ANSI_ARGS_((ClientData instanceData, int mask)); @@ -584,7 +584,7 @@ StdIOOutput( *---------------------------------------------------------------------- */ -static int +static Tcl_WideInt StdIOSeek( ClientData instanceData, /* Unused. */ long offset, /* Offset to seek to. */ @@ -1126,7 +1126,7 @@ FileOutput( *---------------------------------------------------------------------- */ -static int +static Tcl_WideInt FileSeek( ClientData instanceData, /* Unused. */ long offset, /* Offset to seek to. */ diff --git a/win/Makefile.in b/win/Makefile.in index cbb20f6..33b71b4 100644 --- a/win/Makefile.in +++ b/win/Makefile.in @@ -5,7 +5,7 @@ # "autoconf" program (constructs like "@foo@" will get replaced in the # actual Makefile. # -# RCS: @(#) $Id: Makefile.in,v 1.54 2001/09/14 01:00:59 andreas_kupries Exp $ +# RCS: @(#) $Id: Makefile.in,v 1.54.2.1 2001/10/18 09:03:59 dkf Exp $ VERSION = @TCL_VERSION@ @@ -275,7 +275,7 @@ WIN_OBJS = \ tclWinTime.$(OBJEXT) COMPAT_OBJS = \ - strftime.$(OBJEXT) + strftime.$(OBJEXT) strtoll.$(OBJEXT) strtoull.$(OBJEXT) PIPE_OBJS = stub16.$(OBJEXT) diff --git a/win/makefile.bc b/win/makefile.bc index 8406a6e..ff1093b 100644 --- a/win/makefile.bc +++ b/win/makefile.bc @@ -175,6 +175,8 @@ TCLOBJS = \ $(TMPDIR)\regfree.obj \ $(TMPDIR)\regerror.obj \ $(TMPDIR)\strftime.obj \ + $(TMPDIR)\strtoll.obj \ + $(TMPDIR)\strtoull.obj \ $(TMPDIR)\tclAlloc.obj \ $(TMPDIR)\tclAsync.obj \ $(TMPDIR)\tclBasic.obj \ diff --git a/win/makefile.vc b/win/makefile.vc index 03639b3..e3d29b8 100644 --- a/win/makefile.vc +++ b/win/makefile.vc @@ -6,7 +6,7 @@ # Copyright (c) 1995-1996 Sun Microsystems, Inc. # Copyright (c) 1998-2000 Ajuba Solutions. # -# RCS: @(#) $Id: makefile.vc,v 1.65 2001/09/14 01:00:59 andreas_kupries Exp $ +# RCS: @(#) $Id: makefile.vc,v 1.65.2.1 2001/10/18 09:03:59 dkf Exp $ # Does not depend on the presence of any environment variables in # order to compile tcl; all needed information is derived from @@ -163,6 +163,8 @@ TCLOBJS = \ $(TMPDIR)\regfree.obj \ $(TMPDIR)\regerror.obj \ $(TMPDIR)\strftime.obj \ + $(TMPDIR)\strtoll.obj \ + $(TMPDIR)\strtoull.obj \ $(TMPDIR)\tclAlloc.obj \ $(TMPDIR)\tclAsync.obj \ $(TMPDIR)\tclBasic.obj \ diff --git a/win/tclWinChan.c b/win/tclWinChan.c index 78b7daf..b999772 100644 --- a/win/tclWinChan.c +++ b/win/tclWinChan.c @@ -9,7 +9,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinChan.c,v 1.15 2001/09/07 17:08:50 andreas_kupries Exp $ + * RCS: @(#) $Id: tclWinChan.c,v 1.15.6.1 2001/10/18 09:03:59 dkf Exp $ */ #include "tclWinInt.h" @@ -89,7 +89,7 @@ static int FileInputProc _ANSI_ARGS_((ClientData instanceData, char *buf, int toRead, int *errorCode)); static int FileOutputProc _ANSI_ARGS_((ClientData instanceData, char *buf, int toWrite, int *errorCode)); -static int FileSeekProc _ANSI_ARGS_((ClientData instanceData, +static Tcl_WideInt FileSeekProc _ANSI_ARGS_((ClientData instanceData, long offset, int mode, int *errorCode)); static void FileSetupProc _ANSI_ARGS_((ClientData clientData, int flags)); @@ -431,7 +431,7 @@ FileCloseProc(instanceData, interp) *---------------------------------------------------------------------- */ -static int +static Tcl_WideInt FileSeekProc(instanceData, offset, mode, errorCodePtr) ClientData instanceData; /* File state. */ long offset; /* Offset to seek to. */ diff --git a/win/tclWinPort.h b/win/tclWinPort.h index 9e2097d..0098842 100644 --- a/win/tclWinPort.h +++ b/win/tclWinPort.h @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclWinPort.h,v 1.22 2001/09/20 18:33:55 hobbs Exp $ + * RCS: @(#) $Id: tclWinPort.h,v 1.22.2.1 2001/10/18 09:03:59 dkf Exp $ */ #ifndef _TCLWINPORT @@ -464,6 +464,13 @@ typedef int TclpMutex; #define TclpMutexUnlock(a) #endif /* TCL_THREADS */ +#ifdef TCL_WIDE_INT_TYPE +EXTERN Tcl_WideInt strtoll _ANSI_ARGS_((char *string, char **endPtr, + int base)); +EXTERN Tcl_WideUInt strtoull _ANSI_ARGS_((char *string, char **endPtr, + int base)); +#endif /* TCL_WIDE_INT_TYPE */ + #include "tclPlatDecls.h" #include "tclIntPlatDecls.h" |