On 12/09/15 19:18, Robert Millan wrote:
+ If the translation header includes <errno.h>, it won't work on
systems without errno.h. That said, I don't know of any systems with
EFOO but no errno.h. Notably, <rump/foo.h> generally does not include
any "outside" headers to make <rump/> maximally adaptable to any
environment. If the translation header does not include errno.h,
using it is very error-prone (forget to include errno.h and you get
wrong results).
Well, <errno.h> is required by POSIX so if that's the target platform I
think it's
fine to rely on it?
If you want to support non-POSIX systems maybe something like:
#ifndef ERANGE
#error "errno.h or equivalent must be included before this file"
#endif
As ERANGE is required as per ISO/C, I understand it's one of the symbols
which must
always be provided by errno.h (or whatever replaces it).
Hmm. I checked ISO C. Seems like contents of errno.h are required to
be macros, which is good (I was wondering about the #ifdef).
errno.h does not seem to be required by freestanding implementations,
but I think your suggestion is ok. If you don't have errnos, you
probably don't want to translate to non-existent values either.
+ The current <rump/rumperr.h> does not depend on the host having the
concept of errnos, therefore the new routine should probably go into a
separate header. Also, that header was very stupidly named, but I
can't go back and change it anymore.
So let's move to another header then? :)
Well we can't move existing functions. But we can just use
<rump/errtrans.h> (I really have no idea why I called it rumperr.h
instead of just e.g. err.h)
I'll make it so (tomorrow('ish)). Thanks.