From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 28399 invoked by alias); 3 Mar 2003 18:55:38 -0000 Mailing-List: contact gdb-patches-help@sources.redhat.com; run by ezmlm Precedence: bulk List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sources.redhat.com Received: (qmail 28368 invoked from network); 3 Mar 2003 18:55:36 -0000 Received: from unknown (HELO takamaka.act-europe.fr) (142.179.108.108) by 172.16.49.205 with SMTP; 3 Mar 2003 18:55:36 -0000 Received: by takamaka.act-europe.fr (Postfix, from userid 507) id CDB2CD34B6; Mon, 3 Mar 2003 10:55:36 -0800 (PST) Date: Mon, 03 Mar 2003 18:55:00 -0000 From: Joel Brobecker To: bash-maintainers@gnu.org Cc: gdb-patches@sources.redhat.com Subject: Re: Missing check for mbsrtowc causes compilation failure on HP/UX 11.11 Message-ID: <20030303185536.GC19623@gnat.com> References: <20030128050317.GH6437@gnat.com> <20030128050444.GI6437@gnat.com> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="vtzGhvizbBRQ85DL" Content-Disposition: inline In-Reply-To: <20030128050444.GI6437@gnat.com> User-Agent: Mutt/1.4i X-SW-Source: 2003-03/txt/msg00060.txt.bz2 --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Content-length: 514 Dear bash maintainers, I haven't received any feedback regarding this problem, but I noticed that there was a typo in the patch I sent you (an unwanted 's' inside 'mbrtowc'). I have checked the following change in the gdb/readline repository, it does not have the typo. 2003-03-03 Joel Brobecker * aclocal.m4: Add check for mbrtowc. * config.h.in: Regenerate. * configure: Regenerate. * rlmbutil.h: Disable multi-byte if mbrtowc is not defined. -- Joel --vtzGhvizbBRQ85DL Content-Type: text/plain; charset=us-ascii Content-Disposition: attachment; filename="readline.diff" Content-length: 4764 Index: aclocal.m4 =================================================================== RCS file: /cvs/src/src/readline/aclocal.m4,v retrieving revision 1.5 diff -c -3 -p -r1.5 aclocal.m4 *** aclocal.m4 3 Mar 2003 14:45:41 -0000 1.5 --- aclocal.m4 3 Mar 2003 18:46:41 -0000 *************** AC_CHECK_HEADERS(wctype.h) *** 1652,1657 **** --- 1652,1658 ---- AC_CHECK_HEADERS(wchar.h) AC_CHECK_HEADERS(langinfo.h) + AC_CHECK_FUNC(mbrtowc, AC_DEFINE(HAVE_MBRTOWC)) AC_CHECK_FUNC(mbsrtowcs, AC_DEFINE(HAVE_MBSRTOWCS)) AC_CHECK_FUNC(wcwidth, have_wcwidth=yes) if test "$have_wcwidth" = yes; then Index: config.h.in =================================================================== RCS file: /cvs/src/src/readline/config.h.in,v retrieving revision 1.4 diff -c -3 -p -r1.4 config.h.in *** config.h.in 8 Dec 2002 22:31:37 -0000 1.4 --- config.h.in 3 Mar 2003 18:46:41 -0000 *************** *** 31,36 **** --- 31,39 ---- /* Define if you have the lstat function. */ #undef HAVE_LSTAT + /* Define if you have the mbrtowc function. */ + #undef HAVE_MBRTOWC + /* Define if you have the mbsrtowcs function. */ #undef HAVE_MBSRTOWCS Index: configure =================================================================== RCS file: /cvs/src/src/readline/configure,v retrieving revision 1.7 diff -c -3 -p -r1.7 configure *** configure 3 Mar 2003 14:45:42 -0000 1.7 --- configure 3 Mar 2003 18:46:45 -0000 *************** fi *** 6004,6009 **** --- 6004,6088 ---- done + echo "$as_me:$LINENO: checking for mbrtowc" >&5 + echo $ECHO_N "checking for mbrtowc... $ECHO_C" >&6 + if test "${ac_cv_func_mbrtowc+set}" = set; then + echo $ECHO_N "(cached) $ECHO_C" >&6 + else + cat >conftest.$ac_ext <<_ACEOF + #line $LINENO "configure" + /* confdefs.h. */ + _ACEOF + cat confdefs.h >>conftest.$ac_ext + cat >>conftest.$ac_ext <<_ACEOF + /* end confdefs.h. */ + /* System header to define __stub macros and hopefully few prototypes, + which can conflict with char mbrtowc (); below. + Prefer to if __STDC__ is defined, since + exists even on freestanding compilers. */ + #ifdef __STDC__ + # include + #else + # include + #endif + /* Override any gcc2 internal prototype to avoid an error. */ + #ifdef __cplusplus + extern "C" + { + #endif + /* We use char because int might match the return type of a gcc2 + builtin and then its argument prototype would still apply. */ + char mbrtowc (); + /* The GNU C library defines this for functions which it implements + to always fail with ENOSYS. Some functions are actually named + something starting with __ and the normal name is an alias. */ + #if defined (__stub_mbrtowc) || defined (__stub___mbrtowc) + choke me + #else + char (*f) () = mbrtowc; + #endif + #ifdef __cplusplus + } + #endif + + int + main () + { + return f != mbrtowc; + ; + return 0; + } + _ACEOF + rm -f conftest.$ac_objext conftest$ac_exeext + if { (eval echo "$as_me:$LINENO: \"$ac_link\"") >&5 + (eval $ac_link) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); } && + { ac_try='test -s conftest$ac_exeext' + { (eval echo "$as_me:$LINENO: \"$ac_try\"") >&5 + (eval $ac_try) 2>&5 + ac_status=$? + echo "$as_me:$LINENO: \$? = $ac_status" >&5 + (exit $ac_status); }; }; then + ac_cv_func_mbrtowc=yes + else + echo "$as_me: failed program was:" >&5 + sed 's/^/| /' conftest.$ac_ext >&5 + + ac_cv_func_mbrtowc=no + fi + rm -f conftest.$ac_objext conftest$ac_exeext conftest.$ac_ext + fi + echo "$as_me:$LINENO: result: $ac_cv_func_mbrtowc" >&5 + echo "${ECHO_T}$ac_cv_func_mbrtowc" >&6 + if test $ac_cv_func_mbrtowc = yes; then + cat >>confdefs.h <<\_ACEOF + #define HAVE_MBRTOWC 1 + _ACEOF + + fi + echo "$as_me:$LINENO: checking for mbsrtowcs" >&5 echo $ECHO_N "checking for mbsrtowcs... $ECHO_C" >&6 if test "${ac_cv_func_mbsrtowcs+set}" = set; then Index: rlmbutil.h =================================================================== RCS file: /cvs/src/src/readline/rlmbutil.h,v retrieving revision 1.3 diff -c -3 -p -r1.3 rlmbutil.h *** rlmbutil.h 8 Dec 2002 22:31:37 -0000 1.3 --- rlmbutil.h 3 Mar 2003 18:46:45 -0000 *************** *** 35,41 **** #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) # include # include ! # if defined (HAVE_MBSRTOWCS) /* system is supposed to support XPG5 */ # define HANDLE_MULTIBYTE 1 # endif #endif --- 35,42 ---- #if defined (HAVE_WCTYPE_H) && defined (HAVE_WCHAR_H) # include # include ! # if defined (HAVE_MBRTOWC) && defined (HAVE_MBSRTOWCS) ! /* system is supposed to support XPG5 */ # define HANDLE_MULTIBYTE 1 # endif #endif --vtzGhvizbBRQ85DL--