rrthomas/luaposix — pull request #20 by gvvaughan (2011-12-24 05:08:03+00:00)
Title: refactor: use macro splicing for more tabulation.

This would have prevented the recent unsynced signal tables bug,
but also use cpp metaprogramming to write more repetitive code
that needs to stay in sync between various strings and symbols.
* lposix.c (LPOSIX__STR): Remove +1 offset.
(LPOSIX__STR_1, LPOSIX_STR_1): Better name for +1 offset
stringification macros. Adjust all callers.
(sigmacros_map): New cpp table of signal symbol basenames.
(Ssigmacros, Fsigmacros): Generate from sigmacros_map.
(R): Use cpp to keep lua symbols and C implementations in sync.
(luaopen_posix_c): Replace each group of preprocessor exports with
a cpp macro call to keep C API macro values and their lua symbol
names in sync.

Tested and working in Zile zi branch.