summaryrefslogtreecommitdiff
path: root/lib/mbswidth.c
diff options
context:
space:
mode:
authorBruno Haible <bruno@clisp.org>2006-06-28 17:03:53 +0000
committerBruno Haible <bruno@clisp.org>2006-06-28 17:03:53 +0000
commitd0bcee4e6a778c34a4d3e4c922789219c16bfe4b (patch)
tree940e6cda084002a04f581144d65a7787462850f4 /lib/mbswidth.c
parent595fe7f463f7fb72ad6acc58d885585590f8f285 (diff)
downloadgnulib-d0bcee4e6a778c34a4d3e4c922789219c16bfe4b.tar.gz
Fixes after wcwidth module creation.
Diffstat (limited to 'lib/mbswidth.c')
-rw-r--r--lib/mbswidth.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/lib/mbswidth.c b/lib/mbswidth.c
index 754d6df411..ef8398a786 100644
--- a/lib/mbswidth.c
+++ b/lib/mbswidth.c
@@ -32,10 +32,24 @@
/* Get isprint(). */
#include <ctype.h>
-/* Get mbstate_t, mbrtowc(), mbsinit(), wcwidth(). */
+/* Get mbstate_t, mbrtowc(), mbsinit(). */
+#if HAVE_WCHAR_H
+/* Tru64 with Desktop Toolkit C has a bug: <stdio.h> must be included before
+ <wchar.h>.
+ BSD/OS 4.1 has a bug: <stdio.h> and <time.h> must be included before
+ <wchar.h>. */
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+#endif
+
+/* Get wcwidth(). */
#include "wcwidth.h"
/* Get iswcntrl(). */
+#if HAVE_WCTYPE_H
+# include <wctype.h>
+#endif
#if !defined iswcntrl && !HAVE_ISWCNTRL
# define iswcntrl(wc) 0
#endif