Eliminate the `rlimits.h' header using scary macros.
authorMark Wooding <mdw@distorted.org.uk>
Sat, 29 Jun 2013 13:56:57 +0000 (14:56 +0100)
committerMark Wooding <mdw@distorted.org.uk>
Sat, 29 Jun 2013 13:56:57 +0000 (14:56 +0100)
commit1cd4a3bfdaf82f0bc0691671954b239dccb003fb
tree46eb50587a147a51fe82a22fff9da1c3aae21ea1
parente9940d072c811c67f2b3a13782fc40bf591491b7
Eliminate the `rlimits.h' header using scary macros.

The `rlimits.h' header is a bit of a hack, which was thought necessary
because if must assemble a list of things conditionally.  This patch
eliminates this unpleasantness by replacing it with a different hack
which is at least as nasty.

Associate with each potential limit name a macro whose value is either
`t' or `nil', indicating whether the limit is known.  This can be done
using lots of `#ifdef ... #else ... #endif' blocks.  Finally, assemble
a list macro of all of the names, whether they're known or not (because
we can't tell at this point).  The trick is that, instead of just calling
`_(...)' for each item, we call `MAYBE_CALL(_, HAVE_???_P, (...))', and
the latter uses token-pasting to dispatch on the `HAVE_???_P' flag and
conditionally invoke `_(...)'.  Thus callers can work with this as a
conventional list macro.

Of course, building all of this is monumentally tedious, so we get Emacs
to do it for us.
Makefile.am
exec.c
fwd.h
rlimits.h [deleted file]