public inbox for gdb-patches@sourceware.org
 help / color / mirror / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Doug Evans <dje@google.com>
Cc: gdb-patches@sourceware.org
Subject: Re: Building GDB 7.3.92 with MinGW
Date: Fri, 13 Jan 2012 11:28:00 -0000	[thread overview]
Message-ID: <83sjjjkfso.fsf@gnu.org> (raw)
In-Reply-To: <CADPb22TAaiWxS-MjWZtpWutX9857hofz+k9zFCG+UFyExeaMyQ@mail.gmail.com>

> Date: Tue, 10 Jan 2012 10:46:24 -0800
> From: Doug Evans <dje@google.com>
> Cc: gdb-patches@sourceware.org
> 
> On Tue, Jan 10, 2012 at 9:39 AM, Eli Zaretskii <eliz@gnu.org> wrote:
> > I've successfully built the latest pretest of GDB 7.3.92 with MinGW on
> > MS-Windows.  But I did encounter a few minor issues; this is my report
> > about them.
> >
> > 1. Compilation warning:
> >
> >     gcc -O2 -gdwarf-2 -g3 -D__USE_MINGW_ACCESS   -I. -I. -I./common -I./config -DLOCALEDIR="\"/d/usr/share/locale\"" -DHAVE_CONFIG_H -I./../include/opcode -I./../opcodes/.. -I./../readline/.. -I../bfd -I./../bfd -I./../include -I../libdecnumber -I./../libdecnumber -I./../intl -I./gnulib -Ignulib    -I/d/usr/include -Id:/usr/Python26/include -Id:/usr/Python26/include -Wall -Wdeclaration-after-statement -Wpointer-arith -Wformat-nonliteral -Wno-unused -Wunused-value -Wunused-function -Wno-switch -Wno-char-subscripts -Wno-format  -c -o utils.o -MT utils.o -MMD -MP -MF .deps/utils.Tpo utils.c
> >     In file included from gdb_curses.h:30,
> >                      from utils.c:68:
> >     d:/usr/include/curses.h:153:1: warning: "MOUSE_MOVED" redefined
> >     In file included from d:/usr/include/windows.h:49,
> >                      from d:/usr/include/winsock2.h:22,
> >                      from serial.h:24,
> >                      from utils.c:48:
> >     d:/usr/include/wincon.h:58:1: warning: this is the location of the previous definition
> >
> >  Any objections to the following patch?  (If approved, I will add a
> >  comment explaining the problem on Windows which requires this.)
> >
> >     --- gdb/gdb_curses.h~0     2012-01-06 06:43:14.000000000 +0200
> >     +++ gdb/gdb_curses.h       2012-01-10 13:21:10.626119900 +0200
> >     @@ -27,6 +27,9 @@
> >      #elif defined (HAVE_CURSESX_H)
> >      #include <cursesX.h>
> >      #elif defined (HAVE_CURSES_H)
> >     +#if defined(__MINGW32__) && defined(MOUSE_MOVED)
> >     +#undef MOUSE_MOVED
> >     +#endif
> >      #include <curses.h>
> >      #endif
> 
> This is ok with me but remove the "&& defined(MOUSE_MOVED)".
> And one space after defined in "defined(__MINGW32__)".

Thanks.  Here's what I committed, trunk and branch:

 Avoid compiler warnings in gdb_curses.h on MinGW.

 See http://sourceware.org/ml/gdb-patches/2012-01/msg00298.html
 for more details about the problem.

  gdb/gdb_curses.h (MOUSE_MOVED) [__MINGW32__]: Undefine before
  including curses.h.

Index: gdb/ChangeLog
===================================================================
RCS file: /cvs/src/src/gdb/ChangeLog,v
retrieving revision 1.13735
retrieving revision 1.13736
diff -u -r1.13735 -r1.13736
--- gdb/ChangeLog	12 Jan 2012 23:38:46 -0000	1.13735
+++ gdb/ChangeLog	13 Jan 2012 10:44:35 -0000	1.13736
@@ -1,3 +1,8 @@
+2012-01-13  Eli Zaretskii  <eliz@gnu.org>
+
+	* gdb_curses.h (MOUSE_MOVED) [__MINGW32__]: Undefine before
+	including curses.h.
+
 2012-01-12  Jan Kratochvil  <jan.kratochvil@redhat.com>
 
 	* configure: Regenerate.


Index: gdb/gdb_curses.h
===================================================================
RCS file: /cvs/src/src/gdb/gdb_curses.h,v
retrieving revision 1.14
retrieving revision 1.15
diff -u -r1.14 -r1.15
--- gdb/gdb_curses.h	4 Jan 2012 08:17:02 -0000	1.14
+++ gdb/gdb_curses.h	13 Jan 2012 10:44:35 -0000	1.15
@@ -27,6 +27,14 @@
 #elif defined (HAVE_CURSESX_H)
 #include <cursesX.h>
 #elif defined (HAVE_CURSES_H)
+#ifdef __MINGW32__
+/* Windows API headers, included e.g. by serial.h, define MOUSE_MOVED,
+   and so does PDCurses's curses.h, but for an entirely different
+   purpose.  Since we don't use the Windows semantics of MOUSE_MOVED
+   anywhere, avoid compiler warnings by undefining MOUSE_MOVED before
+   including curses.h.  */
+#undef MOUSE_MOVED
+#endif
 #include <curses.h>
 #endif
 

  parent reply	other threads:[~2012-01-13 11:23 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-01-10 18:46 Eli Zaretskii
2012-01-10 18:59 ` Doug Evans
2012-01-10 20:56   ` Eli Zaretskii
2012-01-13 11:28   ` Eli Zaretskii [this message]
2012-01-10 19:25 ` Tom Tromey
2012-01-10 20:55   ` Joseph S. Myers
2012-01-10 20:58   ` Eli Zaretskii
2012-01-10 21:00   ` Eli Zaretskii
2012-01-10 19:31 ` Alfred M. Szmidt
2012-01-10 21:01   ` Eli Zaretskii
2012-01-10 21:26     ` Doug Evans
2012-01-11  0:37       ` asmwarrior
2012-01-11  4:08         ` Eli Zaretskii
2012-01-11  4:54           ` asmwarrior
2012-01-11 17:54         ` Doug Evans
2012-01-12  0:17           ` asmwarrior
2012-01-12  6:47             ` Eli Zaretskii
2012-01-12  8:07               ` Joel Brobecker
2012-01-12 11:54                 ` Eli Zaretskii
2012-01-12 12:35                   ` Joel Brobecker
2012-01-12 16:59                     ` Eli Zaretskii
2012-01-13 14:29                       ` asmwarrior
2012-01-13 16:55                         ` Eli Zaretskii
2012-01-14 13:53                           ` asmwarrior
     [not found]                           ` <4F117B33.8080906@gmail.com>
2012-01-14 18:15                             ` Eli Zaretskii
2012-01-15  3:33                               ` Pierre Muller
     [not found]                               ` <18546.4176851839$1326580387@news.gmane.org>
2012-01-15  3:54                                 ` asmwarrior
     [not found]                               ` <000001ccd30c$5ce854e0$16b8fea0$%muller@ics-cnrs.unistra.fr>
2012-01-15 13:35                                 ` Eli Zaretskii
2012-01-15 17:01                                   ` Joel Brobecker
2012-01-15 18:55                                     ` Eli Zaretskii
2012-01-15 18:01                                   ` Pierre Muller
     [not found]                                   ` <000301ccd3a7$3db8c460$b92a4d20$%muller@ics-cnrs.unistra.fr>
2012-01-15 18:55                                     ` Eli Zaretskii
2012-01-16  3:08                                       ` Pierre Muller
2012-01-10 21:33     ` Tom Tromey
2012-01-11  1:31       ` asmwarrior
2012-01-11  4:30         ` Eli Zaretskii
2012-01-11  4:30           ` asmwarrior
2012-01-11  3:32 ` Joel Brobecker
2012-01-13 11:06   ` Eli Zaretskii
2012-01-13 12:39     ` Joel Brobecker
2012-01-13 13:56       ` Eli Zaretskii

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=83sjjjkfso.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=dje@google.com \
    --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;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).