Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
From: Joel Brobecker <brobecker@gnat.com>
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
Date: Mon, 03 Mar 2003 18:55:00 -0000	[thread overview]
Message-ID: <20030303185536.GC19623@gnat.com> (raw)
In-Reply-To: <20030128050444.GI6437@gnat.com>

[-- Attachment #1: Type: text/plain, Size: 514 bytes --]

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  <brobecker@gnat.com>

        * aclocal.m4: Add check for mbrtowc.
        * config.h.in: Regenerate.
        * configure: Regenerate.
        * rlmbutil.h: Disable multi-byte if mbrtowc is not defined.

-- 
Joel


[-- Attachment #2: readline.diff --]
[-- Type: text/plain, Size: 4764 bytes --]

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 <limits.h> to <assert.h> if __STDC__ is defined, since
+     <limits.h> exists even on freestanding compilers.  */
+ #ifdef __STDC__
+ # include <limits.h>
+ #else
+ # include <assert.h>
+ #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 <wchar.h>
  #  include <wctype.h>
! #  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 <wchar.h>
  #  include <wctype.h>
! #  if defined (HAVE_MBRTOWC) && defined (HAVE_MBSRTOWCS)
!      /* system is supposed to support XPG5 */
  #    define HANDLE_MULTIBYTE      1
  #  endif
  #endif

      parent reply	other threads:[~2003-03-03 18:55 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-28  5:03 Joel Brobecker
2003-01-28  5:04 ` Joel Brobecker
2003-03-03  2:35   ` Elena Zannoni
2003-03-03 19:05     ` Joel Brobecker
2003-03-03 18:55   ` Joel Brobecker [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030303185536.GC19623@gnat.com \
    --to=brobecker@gnat.com \
    --cc=bash-maintainers@gnu.org \
    --cc=gdb-patches@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox