Tue May 11 16:24:00 GMT 2010
On 05/11/2010 09:26 AM, Joel Sherrill wrote:
> I have implemented strsignal.c for RTEMS but
> wondered if it was worth trying to make the
> implementation match the ifdef's in sys/signal.h
> and support other targets?
> I have attached the current implementation. I
> see two approaches to making it support all
> the targets:
> + ifdefs in the table to match the numbers in
> + a long series of code something like this:
> #ifdef SIGXXX
> if ( signal == SIGXXX )
> return "string for SIGXXX";
> Any thoughts or comments?
Yes, IMO it is worth it to make it a shared implementation. Option 2 is
what is used in libc/string/strerror.c for the errno strings.
-- Jeff J.
More information about the Newlib