From patchwork Sun Apr 19 14:26:05 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chen Gang X-Patchwork-Id: 6322 Received: (qmail 31656 invoked by alias); 19 Apr 2015 14:25:58 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 31635 invoked by uid 89); 19 Apr 2015 14:25:58 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=3.1 required=5.0 tests=AWL, BAYES_50, FREEMAIL_ENVFROM_END_DIGIT, FREEMAIL_FROM, RCVD_IN_DNSWL_NONE, SPF_PASS, T_RP_MATCHES_RCVD autolearn=no version=3.3.2 X-Spam-User: qpsmtpd, 2 recipients X-HELO: BLU004-OMC2S38.hotmail.com Received: from blu004-omc2s38.hotmail.com (HELO BLU004-OMC2S38.hotmail.com) (65.55.111.113) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-SHA256 encrypted) ESMTPS; Sun, 19 Apr 2015 14:25:56 +0000 Received: from BLU436-SMTP115 ([65.55.111.72]) by BLU004-OMC2S38.hotmail.com over TLS secured channel with Microsoft SMTPSVC(7.5.7601.22751); Sun, 19 Apr 2015 07:25:54 -0700 X-TMN: [j1RDGYqVInn9gtuPfCm6msOepEPRG5Nu] Message-ID: Date: Sun, 19 Apr 2015 22:26:05 +0800 From: Chen Gang User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:31.0) Gecko/20100101 Thunderbird/31.6.0 MIME-Version: 1.0 To: binutils@sourceware.org, "gdb-patches@sourceware.org" Subject: [PATCH] readline: rltty.c: Declare ioctl() explicitly. Under Darwin, ioctl() is declared in "sys/ioctl.h", but except for some special control commands, we do not want to include "sys/ioctl.h". So declare it explicitly, the related warning: gcc -c -DHAVE_CONFIG_H -I. -I../../binutils-gdb/readline -DRL_LIBRARY_VERSION='"6.2"' -g -O2 ../../binutils-gdb/readline/rltty.c ../../binutils-gdb/readline/rltty.c: In function 'set_winsize': ../../binutils-gdb/readline/rltty.c:83:7: warning: implicit declaration of function 'ioctl' [-Wimplicit-function-declaration] if (ioctl (tty, TIOCGWINSZ, &w) == 0) ^ 2015-04-19 Chen Gang * rltty.c: Declare ioctl() explicitly. --- readline/ChangeLog.gdb | 4 ++++ readline/rltty.c | 4 ++++ 2 files changed, 8 insertions(+) diff --git a/readline/ChangeLog.gdb b/readline/ChangeLog.gdb index a1051aa..dac2a2b 100644 --- a/readline/ChangeLog.gdb +++ b/readline/ChangeLog.gdb @@ -1,5 +1,9 @@ 2015-04-19 Chen Gang + * rltty.c: Declare ioctl() explicitly. + +2015-04-19 Chen Gang + * rlmbutil.h: Declare wcwidth() when HANDLE_MULTIBYTE enabled. 2014-12-30 Eli Zaretskii diff --git a/readline/rltty.c b/readline/rltty.c index d237b1c..ed9c91b 100644 --- a/readline/rltty.c +++ b/readline/rltty.c @@ -39,6 +39,10 @@ #if defined (GWINSZ_IN_SYS_IOCTL) # include +#else +int ioctl(int, unsigned long, ...); /* For Darwin, ioctl() is in "sys/ioctl.h", + but except for special control commands, + we do not want to include it. */ #endif /* GWINSZ_IN_SYS_IOCTL */ #include "rltty.h"