This is the mail archive of the
gdb-patches@sourceware.cygnus.com
mailing list for the GDB project.
Re: HAVE_POLL is not enough - RFA
- To: Andrew Cagney <ac131313 at cygnus dot com>
- Subject: Re: HAVE_POLL is not enough - RFA
- From: Elena Zannoni <ezannoni at cygnus dot com>
- Date: Mon, 20 Mar 2000 15:17:07 -0500 (EST)
- Cc: Philippe De Muyter <phdm at macqel dot be>, Elena Zannoni <ezannoni at cygnus dot com>, gdb-patches at sourceware dot cygnus dot com
- References: <200003181028.LAA30913@mail.macqel.be><38D5BE1D.7BB02C99@cygnus.com>
Agree with Andrew, either of his two suggestions is acceptable.
Elena
Andrew Cagney writes:
> Philippe De Muyter wrote:
> >
> > I implemented the runtime poll/select selection. The patch seems huge because
> > of the indentation changes caused by replacing
> > #if HAVE_POLL
> > some_code
> > #else
> > some_other_code
> > #endif
> >
> > by
> >
> > #if HAVE_POLL
> > if (!use_select)
> > {
> > some_code
> > }
> > else
> > #endif
> > {
> > some_other_code
> > }
>
> Um, to wear the hat of the style police (... :-) I'd suggest instead
> codeing it as:
>
> if (use_poll)
> {
> #if HAVE_POLL
> ...
> #else
> internal_error (...);
> #endif
> }
> else
> {
> }
>
> or even as a psuedo object with a bunch of methods:
>
> some_struct.what_are_we_doing (args);
>
> Andrew