fugalh/druntime — comment on commit 31830469d3eb8916f2a558c1ef13a4c687001b0d
File: src/core/time.d line 1964
By andralex:

I think we have three cases here:

1. clock_gettime does not exist.
2. clock_gettime does exist but sucks.
3. clock_gettime does exist and rocks.

This diff will break the build for case (1). So we should have something like this:

static if(is(typeof(clock_gettime)))
{
if (_use_clock_gettime)
{
... use clock_gettime ...
}
else
{
... use gettimeofday ...
}
}
else
{
... use gettimeofday ...
}

This pattern has some duplication in it, so you may want to factor code out (e.g. in a local function).