summaryrefslogtreecommitdiffstats
path: root/generic/tcl.h
diff options
context:
space:
mode:
authorhobbs <hobbs@noemail.net>2003-07-16 22:06:02 (GMT)
committerhobbs <hobbs@noemail.net>2003-07-16 22:06:02 (GMT)
commitbb1fc3c6d2a0f2b6e9f6e1a731341ba2661ea5dc (patch)
treeebcf5984159e62b71d1bff0188d3b69b72921953 /generic/tcl.h
parentc07d3998a6a629b8dd941a99d1c8bf06cafa67ac (diff)
downloadtcl-bb1fc3c6d2a0f2b6e9f6e1a731341ba2661ea5dc.zip
tcl-bb1fc3c6d2a0f2b6e9f6e1a731341ba2661ea5dc.tar.gz
tcl-bb1fc3c6d2a0f2b6e9f6e1a731341ba2661ea5dc.tar.bz2
* generic/tcl.h: add recognition of -DTCL_UTF_MAX=6 on the
* generic/regcustom.h: make line to support UCS-4 mode. No config arg at this time, as it is not the recommended build mode. FossilOrigin-Name: 20681ebe8b658cad3172ea6a615d9b8f6619cd17
Diffstat (limited to 'generic/tcl.h')
-rw-r--r--generic/tcl.h24
1 files changed, 20 insertions, 4 deletions
diff --git a/generic/tcl.h b/generic/tcl.h
index ddf416d..acdf4e0 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.153.2.5 2003/07/15 22:25:32 dgp Exp $
+ * RCS: @(#) $Id: tcl.h,v 1.153.2.6 2003/07/16 22:06:04 hobbs Exp $
*/
#ifndef _TCL
@@ -2168,18 +2168,34 @@ typedef struct Tcl_Parse {
#define TCL_CONVERT_UNKNOWN -3
#define TCL_CONVERT_NOSPACE -4
-
/*
* The maximum number of bytes that are necessary to represent a single
- * Unicode character in UTF-8.
- */
+ * Unicode character in UTF-8. The valid values should be 3 or 6 (or
+ * perhaps 1 if we want to support a non-unicode enabled core).
+ * If 3, then Tcl_UniChar must be 2-bytes in size (UCS-2). (default)
+ * If 6, then Tcl_UniChar must be 4-bytes in size (UCS-4).
+ * At this time UCS-2 mode is the default and recommended mode.
+ * UCS-4 is experimental and not recommended. It works for the core,
+ * but most extensions expect UCS-2.
+ */
+#ifndef TCL_UTF_MAX
#define TCL_UTF_MAX 3
+#endif
/*
* This represents a Unicode character. Any changes to this should
* also be reflected in regcustom.h.
*/
+#if TCL_UTF_MAX > 3
+ /*
+ * unsigned int isn't 100% accurate as it should be a strict 4-byte
+ * value (perhaps wchar_t). 64-bit systems may have troubles. The
+ * size of this value must be reflected correctly in regcustom.h.
+ */
+typedef unsigned int Tcl_UniChar;
+#else
typedef unsigned short Tcl_UniChar;
+#endif
/*