Gisle Vanem wrote:

> > I didn't see any sub-second sleeper, so I added one using select(). 
> > It's an error to use select() like this on Windows. Hope other targets 
> > allow this (i.e. all fd_set to NULL).
> 
> Ops, something like this is better. I couldn't test this with djgpp
> version under Win-XP since S-Lang doesn't seem to support under Win-XP.
> 
> #ifdef USE_MOUSE
> static void mouse_select_delay (int msec)
> {
> #ifdef _WINDOWS
>     Sleep (msec);
> #else
>     struct timeval tv;
> 
>     msec *= 1000;
>     tv.tv_sec  = msec / 1000000L;
>     tv.tv_usec = msec % 1000000L;
>     (void) select (0, NULL, NULL, NULL, &tv);
> #endif
> }
> #endif

This should not be presented as a mouse-specific function.  If existing
facilities inside Lynx aren't adequate, add a new generic function e.g.
`msec_delay()'.

The _contents_ of that function will, over time, become a snarled mess
of #ifdefs.  You've made a start on that.

BTW, for debugging purposes it's best not to change the args passed to a
function.  If Lynx dumped core while in a `mouse_select_delay(20)' call,
a stack dump would show `mouse_select_delay(20000)', which might confuse
some future person trying to debug Lynx.

>Bela<


_______________________________________________
Lynx-dev mailing list
[EMAIL PROTECTED]
http://lists.nongnu.org/mailman/listinfo/lynx-dev

Reply via email to