This is the mail archive of the gdb-patches@sourceware.cygnus.com mailing list for the GDB project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: HAVE_POLL is not enough - RFA


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

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]