What I've done to solve the immediate C++ problem is to take the
declaration of sys_nerr out of c.h entirely, and put it into the
two C modules that actually need it. However, I'm still wondering
whether we should not drop the rangecheck on errno completely.
One interesting thing I discovered while wandering the web is that
on at least some flavors of Windows, there are valid negative values
of errno --- which our code will not convert to a useful string,
as it stands...
regards, tom lane