summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-10-11 13:22:17 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-10-11 13:22:17 (GMT)
commit4a44772df21154da586138baef4290818aa03110 (patch)
tree56bd203031e5631646da186119c40bf88835419e
parent2807acbcf67e7b82e68ba48b187f2ddcdc0ec2fe (diff)
downloadtcl-4a44772df21154da586138baef4290818aa03110.zip
tcl-4a44772df21154da586138baef4290818aa03110.tar.gz
tcl-4a44772df21154da586138baef4290818aa03110.tar.bz2
* generic/tcl.h: Need a different strategy through the maze of
#defines to let people building with Cygwin build correctly. Also made some comments less misleading...
-rw-r--r--ChangeLog6
-rw-r--r--generic/tcl.h25
2 files changed, 21 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index 565a8ee..03b2de4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2002-10-11 Donal K. Fellows <fellowsd@cs.man.ac.uk>
+
+ * generic/tcl.h: Need a different strategy through the maze of
+ #defines to let people building with Cygwin build correctly. Also
+ made some comments less misleading...
+
2002-10-10 Jeff Hobbs <jeffh@ActiveState.com>
* README: fixed minor nits [Bug #607776] (virden)
diff --git a/generic/tcl.h b/generic/tcl.h
index 459ff6e..7803502 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.145 2002/09/27 18:04:12 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.146 2002/10/11 13:22:23 dkf Exp $
*/
#ifndef _TCL
@@ -328,8 +328,6 @@ typedef long LONG;
* 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...
- *
* Also defines the following macros:
* TCL_WIDE_INT_IS_LONG - if wide ints are really longs (i.e. we're on
* a real 64-bit system.)
@@ -343,11 +341,10 @@ typedef long LONG;
*
* Note on converting between Tcl_WideInt and strings. This
* implementation (in tclObj.c) depends on the functions strtoull()
- * and, where sprintf(...,"%lld",...) does not work, lltostr().
- * Although strtoull() is fairly straight-forward, lltostr() is a most
- * unusual function on Solaris8 (taking its operating buffer
- * backwards) so any changes you make will need to be done
- * cautiously...
+ * and sprintf(...,"%" TCL_LL_MODIFIER "d",...). TCL_LL_MODIFIER_SIZE
+ * is the length of the modifier string, which is "ll" on most 32-bit
+ * Unix systems. It has to be split up like this to allow for the more
+ * complex formats sometimes needed (e.g. in the format(n) command.)
*/
#if !defined(TCL_WIDE_INT_TYPE)&&!defined(TCL_WIDE_INT_IS_LONG)
@@ -398,8 +395,16 @@ typedef struct stat Tcl_StatBuf;
# define Tcl_LongAsWide(val) ((long)(val))
# define Tcl_WideAsDouble(val) ((double)((long)(val)))
# define Tcl_DoubleAsWide(val) ((long)((double)(val)))
+# ifndef TCL_LL_MODIFIER
+# define TCL_LL_MODIFIER "l"
+# define TCL_LL_MODIFIER_SIZE 1
+# endif /* !TCL_LL_MODIFIER */
#else /* TCL_WIDE_INT_IS_LONG */
-# ifndef __WIN32__
+/*
+ * The next short section of defines are only done when not running on
+ * Windows or some other strange platform.
+ */
+# ifndef TCL_LL_MODIFIER
# ifdef HAVE_STRUCT_STAT64
typedef struct stat64 Tcl_StatBuf;
# else
@@ -407,7 +412,7 @@ typedef struct stat Tcl_StatBuf;
# endif /* HAVE_STRUCT_STAT64 */
# define TCL_LL_MODIFIER "ll"
# define TCL_LL_MODIFIER_SIZE 2
-# endif /* !__WIN32__ */
+# endif /* !TCL_LL_MODIFIER */
# define Tcl_WideAsLong(val) ((long)((Tcl_WideInt)(val)))
# define Tcl_LongAsWide(val) ((Tcl_WideInt)((long)(val)))
# define Tcl_WideAsDouble(val) ((double)((Tcl_WideInt)(val)))