20 Apr
2017
20 Apr
'17
12:18 p.m.
On Wednesday, 19 April 2017 12:04:30 CEST Richard W.M. Jones wrote:
On Wed, Apr 19, 2017 at 10:57:28AM +0100, Richard W.M. Jones wrote:
+ struct timespec t; +#define NANOSLEEP(ns) do { \ + t.tv_sec = delay_ns / 1000000000; \ + t.tv_nsec = delay_ns % 1000000000; \ + nanosleep (&t, NULL); \ + } while(0) +
Defining 't' outside its context is a bit clumsy. See attached version of 3/3 which fixes this.
The other option is making it an inline function, so the overhead should be really minimal, while avoiding the scoping issues. -- Pino Toscano