From: Bruno Haible Date: Sat, 20 Dec 2008 11:48:18 +0000 (+0100) Subject: Ensure wctob is declared on IRIX 6.5. X-Git-Tag: v0.1~6568 X-Git-Url: https://erislabs.net/gitweb/?a=commitdiff_plain;ds=sidebyside;h=1d4ebe41d6071d95c1806acaca2cf9372637e9ee;p=gnulib.git Ensure wctob is declared on IRIX 6.5. --- diff --git a/ChangeLog b/ChangeLog index fe5a347b0..ecc957b93 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,15 @@ +2008-12-20 Bruno Haible + + Ensure wctob is declared on IRIX 6.5. + * lib/wchar.in.h (wctob): Declare also when HAVE_DECL_WCTOB is 0. + * m4/wctob.m4 (gl_FUNC_WCTOB): Set HAVE_DECL_WCTOB instead of + HAVE_WCTOB. Also test whether declares wctob. + * m4/wchar.m4 (gl_WCHAR_H_DEFAULTS): Initialize HAVE_DECL_WCTOB instead + of HAVE_WCTOB. + * modules/wchar (Makefile.am): Substitute HAVE_DECL_WCTOB instead of + HAVE_WCTOB. + * doc/posix-functions/wctob.texi: Mention missing declaration on IRIX. + 2008-12-19 Bruno Haible * modules/mbsrtowcs-tests: New file. diff --git a/doc/posix-functions/wctob.texi b/doc/posix-functions/wctob.texi index c4970767c..d61066064 100644 --- a/doc/posix-functions/wctob.texi +++ b/doc/posix-functions/wctob.texi @@ -11,6 +11,9 @@ Portability problems fixed by Gnulib: @item This function is missing on some platforms: HP-UX 11, IRIX 5.3, Solaris 2.6, mingw, Interix 3.5. +@item +This function is missing a declaration on some platforms: +IRIX 6.5. @end itemize Portability problems not fixed by Gnulib: diff --git a/lib/wchar.in.h b/lib/wchar.in.h index af0d978a0..2a8f839ef 100644 --- a/lib/wchar.in.h +++ b/lib/wchar.in.h @@ -97,7 +97,8 @@ extern wint_t btowc (int c); /* Convert a wide character to a single-byte character. */ #if @GNULIB_WCTOB@ -# if !@HAVE_WCTOB@ +# if !defined wctob && !@HAVE_DECL_WCTOB@ +/* wctob is provided by gnulib, or wctob exists but is not declared. */ extern int wctob (wint_t wc); # endif #elif defined GNULIB_POSIXCHECK diff --git a/m4/wchar.m4 b/m4/wchar.m4 index acedc6646..d7455f74a 100644 --- a/m4/wchar.m4 +++ b/m4/wchar.m4 @@ -7,7 +7,7 @@ dnl with or without modifications, as long as this notice is preserved. dnl Written by Eric Blake. -# wchar.m4 serial 11 +# wchar.m4 serial 12 AC_DEFUN([gl_WCHAR_H], [ @@ -70,11 +70,11 @@ AC_DEFUN([gl_WCHAR_H_DEFAULTS], GNULIB_WCWIDTH=0; AC_SUBST([GNULIB_WCWIDTH]) dnl Assume proper GNU behavior unless another module says otherwise. HAVE_BTOWC=1; AC_SUBST([HAVE_BTOWC]) - HAVE_WCTOB=1; AC_SUBST([HAVE_WCTOB]) HAVE_MBSINIT=1; AC_SUBST([HAVE_MBSINIT]) HAVE_MBRTOWC=1; AC_SUBST([HAVE_MBRTOWC]) HAVE_MBRLEN=1; AC_SUBST([HAVE_MBRLEN]) HAVE_MBSRTOWCS=1; AC_SUBST([HAVE_MBSRTOWCS]) + HAVE_DECL_WCTOB=1; AC_SUBST([HAVE_DECL_WCTOB]) HAVE_DECL_WCWIDTH=1; AC_SUBST([HAVE_DECL_WCWIDTH]) REPLACE_WCWIDTH=0; AC_SUBST([REPLACE_WCWIDTH]) WCHAR_H=''; AC_SUBST([WCHAR_H]) diff --git a/m4/wctob.m4 b/m4/wctob.m4 index f511b51ce..b9b83872d 100644 --- a/m4/wctob.m4 +++ b/m4/wctob.m4 @@ -1,4 +1,4 @@ -# wctob.m4 serial 1 +# wctob.m4 serial 2 dnl Copyright (C) 2008 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,10 +10,26 @@ AC_DEFUN([gl_FUNC_WCTOB], AC_CHECK_FUNCS_ONCE([wctob]) if test $ac_cv_func_wctob = no; then - HAVE_WCTOB=0 + HAVE_DECL_WCTOB=0 gl_REPLACE_WCHAR_H AC_LIBOBJ([wctob]) gl_PREREQ_WCTOB + else + dnl IRIX 6.5 has the wctob() function but does not declare it. + AC_CHECK_DECLS([wctob], [], [], [ +/* Tru64 with Desktop Toolkit C has a bug: must be included before + . + BSD/OS 4.0.1 has a bug: , and must be included + before . */ +#include +#include +#include +#include +]) + if test $ac_cv_have_decl_wctob != yes; then + HAVE_DECL_WCTOB=0 + gl_REPLACE_WCHAR_H + fi fi ]) diff --git a/modules/wchar b/modules/wchar index 8953fc184..e38a6daef 100644 --- a/modules/wchar +++ b/modules/wchar @@ -34,11 +34,11 @@ wchar.h: wchar.in.h -e 's|@''GNULIB_WCWIDTH''@|$(GNULIB_WCWIDTH)|g' \ -e 's|@''HAVE_WINT_T''@|$(HAVE_WINT_T)|g' \ -e 's|@''HAVE_BTOWC''@|$(HAVE_BTOWC)|g' \ - -e 's|@''HAVE_WCTOB''@|$(HAVE_WCTOB)|g' \ -e 's|@''HAVE_MBSINIT''@|$(HAVE_MBSINIT)|g' \ -e 's|@''HAVE_MBRTOWC''@|$(HAVE_MBRTOWC)|g' \ -e 's|@''HAVE_MBRLEN''@|$(HAVE_MBRLEN)|g' \ -e 's|@''HAVE_MBSRTOWCS''@|$(HAVE_MBSRTOWCS)|g' \ + -e 's|@''HAVE_DECL_WCTOB''@|$(HAVE_DECL_WCTOB)|g' \ -e 's|@''HAVE_DECL_WCWIDTH''@|$(HAVE_DECL_WCWIDTH)|g' \ -e 's|@''REPLACE_WCWIDTH''@|$(REPLACE_WCWIDTH)|g' \ -e '/definition of GL_LINK_WARNING/r $(LINK_WARNING_H)' \