On 06/10/2013 07:50 PM, Daniel J Sebald wrote:
> char sig_strings[] = {
> #ifdef SIGHUP
>   HUP_STRING, '\0',
> #endif

Yes, that's better, though it should look more like this:

char const sig_strings[] =
#define HUP_OFFSET 0
#ifdef SIGHUP
  "HUP" "\0"
# define INT_OFFSET (HUP_OFFSET + sizeof "HUP")
#else
# define INT_OFFSET HUP_OFFSET
#endif
#ifdef SIGINT
  "INT" "\0"
# define QUIT_OFFSET (INT_OFFSET + sizeof "INT")
#else
# define QUIT_OFFSET INT_OFFSET
#endif
#ifdef SIGQUIT
...
  ;

Maybe someone else can come up with something even better.

Reply via email to