Fix compilation error on platforms without 'wint_t' type.
authorBruno Haible <bruno@clisp.org>
Tue, 24 Oct 2006 20:19:49 +0000 (20:19 +0000)
committerBruno Haible <bruno@clisp.org>
Tue, 24 Oct 2006 20:19:49 +0000 (20:19 +0000)
ChangeLog
lib/wcwidth.h
m4/wcwidth.m4
modules/wcwidth

index a2de46da79041fe52e575bfcccf60a7aba430f53..cad4ec1cf55eedf96e5c7028584d3f1c23efe8c6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-10-24  Bruno Haible  <bruno@clisp.org>
+
+       * modules/wcwidth (Files): Add m4/wint_t.m4.
+       * m4/wcwidth.m4 (gl_FUNC_WCWIDTH): Require gt_TYPE_WINT_T.
+       * lib/wcwidth.h (iswprint): Use 'int' if 'wint_t' is not defined.
+
 2006-10-24  Paul Eggert  <eggert@cs.ucla.edu>
 
        * lib/getdate.y (yyerror): Make the arguments pointer-to-const,
index 37b83cb82256867a2b3ed221d348b37d0c724436..83da8fb0fb71a9617df2934824c8e689a11817fb 100644 (file)
 # endif
 # if !defined iswprint && !HAVE_ISWPRINT
 static inline int
+#  if HAVE_WINT_T
 iswprint (wint_t wc)
+#  else
+iswprint (int wc)
+#  endif
 {
   return (wc >= 0 && wc < 128
          ? wc >= ' ' && wc <= '~'
index 8cdfba436a15f2d1bce11e2de08d9a616fc0a99b..e8a37f2e4f78563f196245bcbd13fce29ce89d98 100644 (file)
@@ -1,4 +1,4 @@
-# wcwidth.m4 serial 5
+# wcwidth.m4 serial 6
 dnl Copyright (C) 2006 Free Software Foundation, Inc.
 dnl This file is free software; the Free Software Foundation
 dnl gives unlimited permission to copy and/or distribute it,
@@ -11,6 +11,7 @@ AC_DEFUN([gl_FUNC_WCWIDTH],
 
   AC_REQUIRE([AC_C_INLINE])
   AC_REQUIRE([gt_TYPE_WCHAR_T])
+  AC_REQUIRE([gt_TYPE_WINT_T])
 
   AC_CHECK_HEADERS_ONCE([wchar.h wctype.h])
   AC_CHECK_FUNCS_ONCE([iswprint wcwidth])
index 74d4ef62d40d1344a45eba780ed58067439deace..d236a4866292962e4ecf97f7b5a10389af060720 100644 (file)
@@ -5,6 +5,7 @@ Files:
 lib/wcwidth.h
 m4/wcwidth.m4
 m4/wchar_t.m4
+m4/wint_t.m4
 
 Depends-on: