summaryrefslogtreecommitdiff
path: root/lib/wcwidth.h
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/wcwidth.h
parent595fe7f463f7fb72ad6acc58d885585590f8f285 (diff)
downloadgnulib-d0bcee4e6a778c34a4d3e4c922789219c16bfe4b.tar.gz
Fixes after wcwidth module creation.
Diffstat (limited to 'lib/wcwidth.h')
-rw-r--r--lib/wcwidth.h44
1 files changed, 31 insertions, 13 deletions
diff --git a/lib/wcwidth.h b/lib/wcwidth.h
index 80c0d9cda7..9af75e0a77 100644
--- a/lib/wcwidth.h
+++ b/lib/wcwidth.h
@@ -18,26 +18,32 @@
#ifndef _gl_WCWIDTH_H
#define _gl_WCWIDTH_H
+#if HAVE_WCHAR_T
+
/* Get wcwidth if available, along with wchar_t. */
-#if HAVE_WCHAR_H
+# 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
+# include <stdio.h>
+# include <time.h>
+# include <wchar.h>
+# endif
/* Get iswprint. */
-#if HAVE_WCTYPE_H
-# include <wctype.h>
-#endif
-#if !defined iswprint && !HAVE_ISWPRINT
-# define iswprint(wc) 1
-#endif
+# if HAVE_WCTYPE_H
+# include <wctype.h>
+# endif
+# if !defined iswprint && !HAVE_ISWPRINT
+# define iswprint(wc) 1
+# endif
-#if !defined wcwidth && !HAVE_WCWIDTH
+# ifndef HAVE_DECL_WCWIDTH
+"this configure-time declaration test was not run"
+# endif
+# ifndef wcwidth
+# if !HAVE_WCWIDTH
/* wcwidth doesn't exist, so assume all printable characters have
width 1. */
@@ -47,6 +53,18 @@ wcwidth (wchar_t wc)
return wc == 0 ? 0 : iswprint (wc) ? 1 : -1;
}
-#endif
+# elif !HAVE_DECL_WCWIDTH
+
+/* wcwidth exists but is not declared. */
+extern
+# ifdef __cplusplus
+"C"
+# endif
+int wcwidth (int /* actually wchar_t */);
+
+# endif
+# endif
+
+#endif /* HAVE_WCHAR_H */
#endif /* _gl_WCWIDTH_H */