This is the mail archive of the binutils@sourceware.org mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] readline: rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.


On fedora 20 x86_64, it has wcwidth() in libc.so.6, but does not declare
it if __USE_XOPEN disabled. readline uses libc library, but does not use
XOPEN, so just declare wcwidth() explicitly is OK.

The related warning:

  gcc -c -DHAVE_CONFIG_H    -I. -I../../binutils-gdb/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 ../../binutils-gdb/readline/display.c
  ../../binutils-gdb/readline/display.c: In function ârl_redisplayâ:
  ../../binutils-gdb/readline/display.c:768:15: warning: implicit declaration of function âwcwidthâ [-Wimplicit-function-declaration]
          temp = wcwidth (wc);
                 ^

2015-04-19  Chen Gang  <gang.chen.5i5j@gmail.com>

	* rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
---
 readline/ChangeLog.gdb | 4 ++++
 readline/rlmbutil.h    | 3 +++
 2 files changed, 7 insertions(+)

diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb
index 43abd19..a1051aa 100644
--- a/readline/ChangeLog.gdb
+++ b/readline/ChangeLog.gdb
@@ -1,3 +1,7 @@
+2015-04-19  Chen Gang  <gang.chen.5i5j@gmail.com>
+
+	* rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled.
+
 2014-12-30  Eli Zaretskii  <eliz@gnu.org>
 
 	* complete.c (stat_char) [_WIN32]: Don't use 'access' and X_OK on
diff --git a/readline/rlmbutil.h b/readline/rlmbutil.h
index 7716a70..e4cd1f4 100644
--- a/readline/rlmbutil.h
+++ b/readline/rlmbutil.h
@@ -96,6 +96,9 @@ extern int _rl_find_next_mbchar PARAMS((char *, int, int, int));
 
 #ifdef HANDLE_MULTIBYTE
 
+extern int wcwidth (wchar_t __c); /* For fedora 20 x86_64, it has wcwitdh(), but
+				     only declared when __USE_XOPEN.  */
+
 extern int _rl_compare_chars PARAMS((char *, int, mbstate_t *, char *, int, mbstate_t *));
 extern int _rl_get_char_len PARAMS((char *, mbstate_t *));
 extern int _rl_adjust_point PARAMS((char *, int, mbstate_t *));
-- 
1.9.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]