diff options
author | Jim Meyering <jim@meyering.net> | 2000-07-24 06:14:19 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 2000-07-24 06:14:19 +0000 |
commit | 1978f5651553e83cfa5af4ab064b62240e1187aa (patch) | |
tree | 9f10d58f0281e1835e01d219fd3092086db03915 /lib/quotearg.c | |
parent | d53f7b9a5d7cb865c65b32f9d31d62c02e8169ad (diff) | |
download | coreutils-1978f5651553e83cfa5af4ab064b62240e1187aa.tar.xz |
Include <wchar.h> even if ! (HAVE_MBRTOWC && 1 < MB_LEN_MAX),
so that mbstate_t is always defined.
Do not inspect MB_LEN_MAX, since it's incorrectly defined to
be 1 in at least one GCC installation, and this configuration
error is likely to be common. Ignoring MB_LEN_MAX hurts
performance on hosts that have mbrtowc but have only unibyte
locales, but I assume these hosts are rare.
Diffstat (limited to 'lib/quotearg.c')
-rw-r--r-- | lib/quotearg.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/quotearg.c b/lib/quotearg.c index 47152bca4..9ed8a5fb1 100644 --- a/lib/quotearg.c +++ b/lib/quotearg.c @@ -59,11 +59,12 @@ # include <string.h> #endif -#if HAVE_MBRTOWC && 1 < MB_LEN_MAX +#if HAVE_WCHAR_H +# include <wchar.h> +#endif + +#if HAVE_MBRTOWC size_t mbrtowc (); -# if HAVE_WCHAR_H -# include <wchar.h> -# endif # ifdef mbstate_t # define mbrtowc(pwc, s, n, ps) (mbrtowc) (pwc, s, n, 0) # define mbsinit(ps) 1 |