summaryrefslogtreecommitdiffstats
path: root/sys/i386
diff options
context:
space:
mode:
authorobrien <obrien@FreeBSD.org>2001-05-16 22:32:44 +0000
committerobrien <obrien@FreeBSD.org>2001-05-16 22:32:44 +0000
commit89ba5881e53f6b82743a1e5ea6f9db8ad458997c (patch)
treecae039e1a2c56a600baa436c6d3915971799b673 /sys/i386
parent9e804492abbf2ff2087fc952f4b0b98a6e3f8ba7 (diff)
downloadFreeBSD-src-89ba5881e53f6b82743a1e5ea6f9db8ad458997c.zip
FreeBSD-src-89ba5881e53f6b82743a1e5ea6f9db8ad458997c.tar.gz
Consistently define the rune types.
Follow NetBSD's lead and add a _BSD_MBSTATE_T_ type.
Diffstat (limited to 'sys/i386')
-rw-r--r--sys/i386/include/ansi.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/sys/i386/include/ansi.h b/sys/i386/include/ansi.h
index b9b62da..8f41b26 100644
--- a/sys/i386/include/ansi.h
+++ b/sys/i386/include/ansi.h
@@ -93,12 +93,14 @@ typedef unsigned int __uintptr_t;
* one (perhaps nonstandard) header are defined here. Standard headers
* use _BSD_XXX_T_ without undef'ing it.
*/
-#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
#define _BSD_OFF_T_ __int64_t /* file offset */
#define _BSD_PID_T_ int /* process [group] */
#define _BSD_VA_LIST_ char * /* va_list */
/*
+ * NOTE: rune_t is not covered by ANSI nor other standards, and should not
+ * be instantiated outside of lib/libc/locale. Use wchar_t.
+ *
* The rune type is declared to be an ``int'' instead of the more natural
* ``unsigned long'' or ``long''. Two things are happening here. It is not
* unsigned so that EOF (-1) can be naturally assigned to it and used. Also,
@@ -108,7 +110,23 @@ typedef unsigned int __uintptr_t;
* ANSI C), but they use _BSD_CT_RUNE_T_ instead of int. By changing it
* here, you lose a bit of ANSI conformance, but your programs will still
* work.
+ *
+ * Note that _WCHAR_T_ and _RUNE_T_ must be of the same type.
+ */
+#define _BSD_CT_RUNE_T_ int /* arg type for ctype funcs */
+#define _BSD_RUNE_T_ _BSD_CT_RUNE_T_ /* rune_t */
+#define _BSD_WCHAR_T_ _BSD_CT_RUNE_T_ /* wchar_t */
+#define _BSD_WINT_T_ _BSD_CT_RUNE_T_ /* wint_t */
+
+/*
+ * mbstate_t is an opaque object to keep conversion state, during multibyte
+ * stream conversions. The content must not be referenced by user programs.
*/
+typedef union {
+ char __mbstate8[128];
+ __int64_t _mbstateL; /* for alignment */
+ } __mbstate_t;
+#define _BSD_MBSTATE_T_ __mbstate_t /* mbstate_t */
/*
* Frequencies of the clock ticks reported by clock() and times(). They
OpenPOWER on IntegriCloud