summaryrefslogtreecommitdiffstats
path: root/contrib/tcsh/config_f.h
diff options
context:
space:
mode:
authormp <mp@FreeBSD.org>2005-04-24 19:41:08 +0000
committermp <mp@FreeBSD.org>2005-04-24 19:41:08 +0000
commit94a109bd814074f290affa8f7698847719d55833 (patch)
tree6daeb0464a7bc8705c0246b7fd98e212b6beed09 /contrib/tcsh/config_f.h
parentbbd1addf8f9452690ad13ce5b875ee4cc9633958 (diff)
downloadFreeBSD-src-94a109bd814074f290affa8f7698847719d55833.zip
FreeBSD-src-94a109bd814074f290affa8f7698847719d55833.tar.gz
Import of tcsh-6.14.00
Diffstat (limited to 'contrib/tcsh/config_f.h')
-rw-r--r--contrib/tcsh/config_f.h45
1 files changed, 41 insertions, 4 deletions
diff --git a/contrib/tcsh/config_f.h b/contrib/tcsh/config_f.h
index d28ca90..2f3f403 100644
--- a/contrib/tcsh/config_f.h
+++ b/contrib/tcsh/config_f.h
@@ -1,4 +1,4 @@
-/* $Header: /src/pub/tcsh/config_f.h,v 3.26 2004/03/21 16:48:14 christos Exp $ */
+/* $Header: /src/pub/tcsh/config_f.h,v 3.32 2005/03/04 13:46:04 christos Exp $ */
/*
* config_f.h -- configure various defines for tcsh
*
@@ -39,7 +39,7 @@
#define _h_config_f
/*
- * SHORT_STRINGS Use 16 bit characters instead of 8 bit chars
+ * SHORT_STRINGS Use at least 16 bit characters instead of 8 bit chars
* This fixes up quoting problems and eases implementation
* of nls...
*
@@ -47,6 +47,14 @@
#define SHORT_STRINGS
/*
+ * WIDE_STRINGS Represent strings using wide characters
+ * Allows proper function in multibyte encodings like UTF-8
+ */
+#if defined (SHORT_STRINGS) && SIZEOF_WCHAR_T >= 4 && !defined (WINNT_NATIVE) && !defined(_OSD_POSIX)
+# define WIDE_STRINGS
+#endif
+
+/*
* NLS: Use Native Language System
* Routines like setlocale() are needed
* if you don't have <locale.h>, you don't want
@@ -110,7 +118,7 @@
/*
* KANJI Ignore meta-next, and the ISO character set. Should
- * be used with SHORT_STRINGS
+ * be used with SHORT_STRINGS (or WIDE_STRINGS)
*
*/
#define KANJI
@@ -120,7 +128,9 @@
* only output, when "dspmbyte" is set. Should be used with
* KANJI
*/
-#define DSPMBYTE
+#if defined (SHORT_STRINGS) && !defined (WIDE_STRINGS)
+# define DSPMBYTE
+#endif
/*
* MBYTEDEBUG when "dspmbyte" is changed, set multi-byte checktable to
@@ -191,4 +201,31 @@
# define RCSID(id) /* Nothing */
#endif /* !lint && !SABER */
+/* Consistency checks */
+#ifdef WIDE_STRINGS
+# if SIZEOF_WCHAR_T < 4
+ #error "wchar_t must be at least 4 bytes for WIDE_STRINGS"
+# endif
+
+# ifdef WINNT_NATIVE
+ #error "WIDE_STRINGS cannot be used together with WINNT_NATIVE"
+# endif
+
+# ifndef SHORT_STRINGS
+ #error "SHORT_STRINGS must be defined if WIDE_STRINGS is defined"
+# endif
+
+# ifndef NLS
+ #error "NLS must be defined if WIDE_STRINGS is defined"
+# endif
+
+# ifdef DSPMBYTE
+ #error "DSPMBYTE must not be defined if WIDE_STRINGS is defined"
+# endif
+#endif
+
+#if !defined (SHORT_STRINGS) && defined (DSPMBYTE)
+ #error "SHORT_STRINGS must be defined if DSPMBYTE is defined"
+#endif
+
#endif /* _h_config_f */
OpenPOWER on IntegriCloud