Mirror of the gdb-patches mailing list
 help / color / mirror / Atom feed
* [ob] Fix mingw build
@ 2007-02-05 13:23 Daniel Jacobowitz
  2007-02-05 21:33 ` Nick Roberts
  0 siblings, 1 reply; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-02-05 13:23 UTC (permalink / raw)
  To: gdb-patches

Our autotester broke after Nick's timings patch; we have a forward
declaration of struct timeval, but not a full definition.  This fixes
it.  We already include <sys/time.h> unconditionally in a number of
other places.

Tested i586-mingw32msvc and committed.

-- 
Daniel Jacobowitz
CodeSourcery

2007-02-05  Daniel Jacobowitz  <dan@codesourcery.com>

	* mi/mi-parse.h: Include <sys/time.h>.

Index: mi/mi-parse.h
===================================================================
RCS file: /cvs/src/src/gdb/mi/mi-parse.h,v
retrieving revision 1.7
diff -u -p -r1.7 mi-parse.h
--- mi/mi-parse.h	2 Feb 2007 23:01:27 -0000	1.7
+++ mi/mi-parse.h	5 Feb 2007 13:20:56 -0000
@@ -22,6 +22,8 @@
 #ifndef MI_PARSE_H
 #define MI_PARSE_H
 
+#include <sys/time.h>
+
 /* MI parser */
 
 /* Timestamps for current command and last asynchronous command.  */


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ob] Fix mingw build
  2007-02-05 13:23 [ob] Fix mingw build Daniel Jacobowitz
@ 2007-02-05 21:33 ` Nick Roberts
  2007-02-05 21:37   ` Daniel Jacobowitz
  0 siblings, 1 reply; 3+ messages in thread
From: Nick Roberts @ 2007-02-05 21:33 UTC (permalink / raw)
  To: Daniel Jacobowitz; +Cc: gdb-patches

 > Our autotester broke after Nick's timings patch; we have a forward
 > declaration of struct timeval, but not a full definition.  This fixes
 > it.  We already include <sys/time.h> unconditionally in a number of
 > other places.

I don't quite understand why it failed as the timeval members are only 
accessed in mi-main.c which already included sys/time.h (for mi_load_progress).

 > Index: mi/mi-parse.h
 > ===================================================================
 > RCS file: /cvs/src/src/gdb/mi/mi-parse.h,v
 > retrieving revision 1.7
 > diff -u -p -r1.7 mi-parse.h
 > --- mi/mi-parse.h	2 Feb 2007 23:01:27 -0000	1.7
 > +++ mi/mi-parse.h	5 Feb 2007 13:20:56 -0000
 > @@ -22,6 +22,8 @@
 >  #ifndef MI_PARSE_H
 >  #define MI_PARSE_H
 >  
 > +#include <sys/time.h>
 > +
 >  /* MI parser */
 >  
 >  /* Timestamps for current command and last asynchronous command.  */


It's best here anyway.  Although it doesn't break anything, maybe it should be
removed from mi-main.c now.

-- 
Nick                                           http://www.inet.net.nz/~nickrob


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [ob] Fix mingw build
  2007-02-05 21:33 ` Nick Roberts
@ 2007-02-05 21:37   ` Daniel Jacobowitz
  0 siblings, 0 replies; 3+ messages in thread
From: Daniel Jacobowitz @ 2007-02-05 21:37 UTC (permalink / raw)
  To: Nick Roberts; +Cc: gdb-patches

On Tue, Feb 06, 2007 at 10:32:48AM +1300, Nick Roberts wrote:
>  > Our autotester broke after Nick's timings patch; we have a forward
>  > declaration of struct timeval, but not a full definition.  This fixes
>  > it.  We already include <sys/time.h> unconditionally in a number of
>  > other places.
> 
> I don't quite understand why it failed as the timeval members are only 
> accessed in mi-main.c which already included sys/time.h (for mi_load_progress).

Because struct mi_timestamp contains struct timeval members.  If you
don't have a definition of the structure in scope, then it's
"incomplete" - the compiler does not know what size it is, so it can
not lay out a structure containing one.

> It's best here anyway.  Although it doesn't break anything, maybe it should be
> removed from mi-main.c now.

I tend to leave it - that file will need it even if it's removed from
here for some reason.

-- 
Daniel Jacobowitz
CodeSourcery


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-05 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-02-05 13:23 [ob] Fix mingw build Daniel Jacobowitz
2007-02-05 21:33 ` Nick Roberts
2007-02-05 21:37   ` Daniel Jacobowitz

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox