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: Philippe De Muyter <phdm at macqel dot be>, Elena Zannoni <ezannoni at cygnus dot com>
- Subject: Re: HAVE_POLL is not enough - RFA
- From: Andrew Cagney <ac131313 at cygnus dot com>
- Date: Mon, 20 Mar 2000 16:58:53 +1100
- CC: gdb-patches at sourceware dot cygnus dot com
- Organization: Cygnus Solutions
- References: <200003181028.LAA30913@mail.macqel.be>
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