diff options
| author | tshiozak <tshiozak@NetBSD.org> | 2002-03-18 22:58:44 +0000 |
|---|---|---|
| committer | tshiozak <tshiozak@NetBSD.org> | 2002-03-18 22:58:44 +0000 |
| commit | f4b38752de4ba71c3c7ef5fdbd1ef5fb087ef359 (patch) | |
| tree | 64839d65686c0023584e564e0d0372272794f6d7 /lib | |
| parent | 09a6f546a32f1c19b8f1c940e301cd8008a78fcf (diff) | |
Move mbstate_t materials from locale/runetype.h to locale/multibyte.h.
Before this fix, building nbmklocale was failed on non-NetBSD-current platforms.
multibyte.h seems more appropriate one to contain them.
Diffstat (limited to 'lib')
| -rw-r--r-- | lib/libc/locale/multibyte.h | 25 | ||||
| -rw-r--r-- | lib/libc/locale/runetype.h | 23 | ||||
| -rw-r--r-- | lib/libc/locale/setrunelocale.c | 5 |
3 files changed, 28 insertions, 25 deletions
diff --git a/lib/libc/locale/multibyte.h b/lib/libc/locale/multibyte.h index b3d712a83f6..b55cd72ff6b 100644 --- a/lib/libc/locale/multibyte.h +++ b/lib/libc/locale/multibyte.h @@ -1,4 +1,4 @@ -/* $NetBSD: multibyte.h,v 1.1 2002/03/17 22:14:29 tshiozak Exp $ */ +/* $NetBSD: multibyte.h,v 1.2 2002/03/18 22:58:44 tshiozak Exp $ */ /*- * Copyright (c)2002 Citrus Project, @@ -29,6 +29,29 @@ #ifndef _MULTIBYTE_H_ #define _MULTIBYTE_H_ +/* mbstate_t private */ + +#ifdef _BSD_MBSTATE_T_ +typedef _BSD_MBSTATE_T_ mbstate_t; +#undef _BSD_MBSTATE_T_ +#endif + +typedef struct _RuneStatePriv { + _RuneLocale *__runelocale; + char __private __attribute__((__aligned__)); +} _RuneStatePriv; + +typedef union _RuneState { + mbstate_t __pad; + struct _RuneStatePriv __priv; +#define rs_runelocale __priv.__runelocale +#define rs_private __priv.__private +} _RuneState; +#define _PRIVSIZE (sizeof(mbstate_t)-offsetof(_RuneStatePriv, __private)) + + +/* */ + static __inline _citrus_ctype_t _to_cur_ctype(void) { diff --git a/lib/libc/locale/runetype.h b/lib/libc/locale/runetype.h index 937088fcc80..1a3068bc478 100644 --- a/lib/libc/locale/runetype.h +++ b/lib/libc/locale/runetype.h @@ -1,4 +1,4 @@ -/* $NetBSD: runetype.h,v 1.8 2002/03/18 22:25:43 yamt Exp $ */ +/* $NetBSD: runetype.h,v 1.9 2002/03/18 22:58:44 tshiozak Exp $ */ /*- * Copyright (c) 1993 @@ -49,11 +49,6 @@ typedef _BSD_RUNE_T_ rune_t; #undef _BSD_RUNE_T_ #endif -#ifdef _BSD_MBSTATE_T_ -typedef _BSD_MBSTATE_T_ mbstate_t; -#undef _BSD_MBSTATE_T_ -#endif - typedef uint64_t __runepad_t; extern size_t __mb_len_max_runtime; @@ -184,22 +179,6 @@ typedef struct _RuneLocale { } _RuneLocale; -/* mbstate_t private */ - -typedef struct _RuneStatePriv { - _RuneLocale *__runelocale; - char __private __attribute__((__aligned__)); -} _RuneStatePriv; - -typedef union _RuneState { - mbstate_t __pad; - struct _RuneStatePriv __priv; -#define rs_runelocale __priv.__runelocale -#define rs_private __priv.__private -} _RuneState; -#define _PRIVSIZE (sizeof(mbstate_t)-offsetof(_RuneStatePriv, __private)) - - /* magic number for LC_CTYPE (rune)locale declaration */ #define _RUNE_MAGIC_1 "RuneCT10" /* Indicates version 0 of RuneLocale */ diff --git a/lib/libc/locale/setrunelocale.c b/lib/libc/locale/setrunelocale.c index a70c3227a99..375b56204b6 100644 --- a/lib/libc/locale/setrunelocale.c +++ b/lib/libc/locale/setrunelocale.c @@ -1,4 +1,4 @@ -/* $NetBSD: setrunelocale.c,v 1.10 2002/03/18 11:49:19 yamt Exp $ */ +/* $NetBSD: setrunelocale.c,v 1.11 2002/03/18 22:58:44 tshiozak Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -100,7 +100,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: setrunelocale.c,v 1.10 2002/03/18 11:49:19 yamt Exp $"); +__RCSID("$NetBSD: setrunelocale.c,v 1.11 2002/03/18 22:58:44 tshiozak Exp $"); #endif /* LIBC_SCCS and not lint */ /*#include "namespace.h"*/ @@ -118,6 +118,7 @@ __RCSID("$NetBSD: setrunelocale.c,v 1.10 2002/03/18 11:49:19 yamt Exp $"); #include <citrus/citrus_module.h> #include <citrus/citrus_ctype.h> #include "rune_local.h" +#include "multibyte.h" struct localetable { char path[PATH_MAX]; |
