From 09cc2e4029b6e1601a44a05688449b9834918fae Mon Sep 17 00:00:00 2001 From: Bruno Haible Date: Mon, 21 Aug 2006 18:28:02 +0000 Subject: [PATCH] Portability to BeOS. --- ChangeLog | 6 ++++++ lib/ChangeLog | 5 +++++ lib/mbchar.h | 5 ++++- m4/ChangeLog | 6 ++++++ m4/mbchar.m4 | 13 +++++++------ modules/mbchar | 2 +- 6 files changed, 29 insertions(+), 8 deletions(-) diff --git a/ChangeLog b/ChangeLog index 91a19d27f..e3880fffc 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2006-08-19 Bruno Haible + + BeOS portability. + * modules/mbchar (Include): Don't test HAVE_WCTYPE_H any more, since + BeOS has mbrtowc() but no . + 2006-08-21 Bruno Haible * gnulib-tool (func_emit_lib_Makefile_am, func_emit_tests_Makefile_am): diff --git a/lib/ChangeLog b/lib/ChangeLog index cc8d1c875..5705f2a6d 100644 --- a/lib/ChangeLog +++ b/lib/ChangeLog @@ -1,3 +1,8 @@ +2006-08-19 Bruno Haible + + BeOS portability. + * mbchar.h: Include only if it exists. + 2006-08-20 Paul Eggert * cycle-check.h: Include unconditionally, since we diff --git a/lib/mbchar.h b/lib/mbchar.h index 52b107578..bf31027ce 100644 --- a/lib/mbchar.h +++ b/lib/mbchar.h @@ -156,7 +156,10 @@ #include #include -#include +/* BeOS 5 has the functions but no . */ +#if HAVE_WCTYPE_H +# include +#endif /* FreeBSD 4.4 to 4.11 has but lacks the functions. Assume all 12 functions are implemented the same way, or not at all. */ #if !defined iswalnum && !HAVE_ISWCNTRL diff --git a/m4/ChangeLog b/m4/ChangeLog index 8f525b6a3..919e79b9a 100644 --- a/m4/ChangeLog +++ b/m4/ChangeLog @@ -1,3 +1,9 @@ +2006-08-19 Bruno Haible + + BeOS portability. + * mbchar.m4 (gl_MBCHAR): Compile mbchar.c also if doesn't + exist. + 2006-08-20 Paul Eggert Remove files that are no longer needed by their respective modules. diff --git a/m4/mbchar.m4 b/m4/mbchar.m4 index ec4cbab11..f95e9267c 100644 --- 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 @@ dnl From Bruno Haible. 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 ]) diff --git a/modules/mbchar b/modules/mbchar index c43036144..13b9e41f7 100644 --- a/modules/mbchar +++ b/modules/mbchar @@ -17,7 +17,7 @@ Makefile.am: lib_SOURCES += mbchar.h Include: -#if HAVE_WCHAR_H && HAVE_WCTYPE_H +#if HAVE_WCHAR_H #include "mbchar.h" #endif -- 2.11.0