changeset 7170:9030679f62dd

Portability to BeOS.
author Bruno Haible <bruno@clisp.org>
date Mon, 21 Aug 2006 18:28:02 +0000
parents cb505deddb22
children bc1c94eecdb1
files ChangeLog lib/ChangeLog lib/mbchar.h m4/ChangeLog m4/mbchar.m4 modules/mbchar
diffstat 6 files changed, 29 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-19  Bruno Haible  <bruno@clisp.org>
+
+	BeOS portability.
+	* modules/mbchar (Include): Don't test HAVE_WCTYPE_H any more, since
+	BeOS has mbrtowc() but no <wctype.h>.
+
 2006-08-21  Bruno Haible <bruno@clisp.org>
 
 	* gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am):
--- a/lib/ChangeLog
+++ b/lib/ChangeLog
@@ -1,3 +1,8 @@
+2006-08-19  Bruno Haible  <bruno@clisp.org>
+
+	BeOS portability.
+	* mbchar.h: Include <wctype.h> only if it exists.
+
 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
 
 	* cycle-check.h: Include <stdint.h> unconditionally, since we
--- a/lib/mbchar.h
+++ b/lib/mbchar.h
@@ -156,7 +156,10 @@
 #include <time.h>
 #include <wchar.h>
 
-#include <wctype.h>
+/* BeOS 5 has the functions but no <wctype.h>.  */
+#if HAVE_WCTYPE_H
+# include <wctype.h>
+#endif
 /* FreeBSD 4.4 to 4.11 has <wctype.h> but lacks the functions.
    Assume all 12 functions are implemented the same way, or not at all.  */
 #if !defined iswalnum && !HAVE_ISWCNTRL
--- a/m4/ChangeLog
+++ b/m4/ChangeLog
@@ -1,3 +1,9 @@
+2006-08-19  Bruno Haible  <bruno@clisp.org>
+
+	BeOS portability.
+	* mbchar.m4 (gl_MBCHAR): Compile mbchar.c also if <wctype.h> doesn't
+	exist.
+
 2006-08-20  Paul Eggert  <eggert@cs.ucla.edu>
 
 	Remove files that are no longer needed by their respective modules.
--- a/m4/mbchar.m4
+++ b/m4/mbchar.m4
@@ -1,4 +1,4 @@
-# mbchar.m4 serial 3
+# mbchar.m4 serial 4
 dnl Copyright (C) 2005-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,
@@ -10,13 +10,14 @@
 AC_DEFUN([gl_MBCHAR],
 [
   AC_REQUIRE([AC_GNU_SOURCE])
-  dnl The following line is that so the user can test
-  dnl HAVE_WCHAR_H && HAVE_WCTYPE_H before #include "mbchar.h".
-  AC_CHECK_HEADERS_ONCE(wchar.h wctype.h)
-  dnl Compile mbchar.c only if HAVE_WCHAR_H && HAVE_WCTYPE_H.
-  if test $ac_cv_header_wchar_h = yes && test $ac_cv_header_wctype_h = yes; then
+  dnl The following line is that so the user can test HAVE_WCHAR_H
+  dnl before #include "mbchar.h".
+  AC_CHECK_HEADERS_ONCE([wchar.h])
+  dnl Compile mbchar.c only if HAVE_WCHAR_H.
+  if test $ac_cv_header_wchar_h = yes; then
     AC_LIBOBJ([mbchar])
     dnl Prerequisites of mbchar.h and mbchar.c.
+    AC_CHECK_HEADERS_ONCE([wctype.h])
     AC_CHECK_FUNCS([iswcntrl])
   fi
 ])
--- a/modules/mbchar
+++ b/modules/mbchar
@@ -17,7 +17,7 @@
 lib_SOURCES += mbchar.h
 
 Include:
-#if HAVE_WCHAR_H && HAVE_WCTYPE_H
+#if HAVE_WCHAR_H
 #include "mbchar.h"
 #endif