From: Chen Gang <xili_gchen_5257@hotmail.com>
To: binutils@sourceware.org,
"gdb-patches@sourceware.org" <gdb-patches@sourceware.org>
Subject: [PATCH] readline: rltty.c: Declare ioctl() explicitly.
Date: Sun, 19 Apr 2015 14:25:00 -0000 [thread overview]
Message-ID: <BLU436-SMTP115C989365A0C460ADEB606B9E10@phx.gbl> (raw)
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 <gang.chen.5i5j@gmail.com>
* 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 <gang.chen.5i5j@gmail.com>
+ * rltty.c: Declare ioctl() explicitly.
+
+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>
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 <sys/ioctl.h>
+#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"
--
1.9.3
next reply other threads:[~2015-04-19 14:25 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-04-19 14:25 Chen Gang [this message]
2015-04-19 16:46 ` Mike Frysinger
2015-04-19 17:45 ` Chen Gang
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=BLU436-SMTP115C989365A0C460ADEB606B9E10@phx.gbl \
--to=xili_gchen_5257@hotmail.com \
--cc=binutils@sourceware.org \
--cc=gdb-patches@sourceware.org \
/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