This is the mail archive of the
newlib@sources.redhat.com
mailing list for the newlib project.
Re: Make string.h strsignal prototype return const char *
- From: Jeff Johnston <jjohnstn at redhat dot com>
- To: Hans-Peter Nilsson <hans-peter dot nilsson at axis dot com>
- Cc: newlib at sources dot redhat dot com
- Date: Fri, 21 Jan 2005 16:21:02 -0500
- Subject: Re: Make string.h strsignal prototype return const char *
- References: <200501211921.j0LJL0kI002348@ignucius.se.axis.com>
Hans-Peter Nilsson wrote:
Date: Fri, 21 Jan 2005 13:52:22 -0500
From: Jeff Johnston <jjohnstn@redhat.com>
An alternative to your solution would be to move the strsignal declaration out
of string.h and into a new libc/sys/linux/sys/string.h. Have string.h #include
<sys/string.h>. In libc/include/sys/string.h have a placeholder comment. With
the exception of sys/config.h I'm not too keen on having linux-only stuff in
shared header files, especially since libc/sys/linux overrides many headers
already to avoid this mess.
That does seem like a cleaner solution.
If I put this together, would you be willing to try it out?
Sure!
Great, here it is. Let me know.
-- Jeff J.
Index: libc/include/string.h
===================================================================
RCS file: /cvs/src/src/newlib/libc/include/string.h,v
retrieving revision 1.14
diff -u -r1.14 string.h
--- libc/include/string.h 23 Jul 2002 21:38:00 -0000 1.14
+++ libc/include/string.h 21 Jan 2005 21:19:29 -0000
@@ -75,8 +75,6 @@
const char *_EXFUN(strsignal, (int __signo));
#endif
int _EXFUN(strtosigno, (const char *__name));
-#elif defined(__linux__)
-char *_EXFUN(strsignal, (int __signo));
#endif
/* These function names are used on Windows and perhaps other systems. */
@@ -95,6 +93,8 @@
#endif /* ! __STRICT_ANSI__ */
+#include <sys/string.h>
+
_END_STD_C
#endif /* _STRING_H_ */
Index: libc/include/sys/string.h
===================================================================
RCS file: libc/include/sys/string.h
diff -N libc/include/sys/string.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libc/include/sys/string.h 21 Jan 2005 21:19:29 -0000
@@ -0,0 +1,2 @@
+/* This is a dummy <sys/string.h> used as a placeholder for
+ systems that need to have a special header file. */
Index: libc/sys/linux/sys/string.h
===================================================================
RCS file: libc/sys/linux/sys/string.h
diff -N libc/sys/linux/sys/string.h
--- /dev/null 1 Jan 1970 00:00:00 -0000
+++ libc/sys/linux/sys/string.h 21 Jan 2005 21:19:29 -0000
@@ -0,0 +1,10 @@
+#ifndef _SYS_STRING_H
+#define _SYS_STRING_H
+
+#ifndef __STRICT_ANSI__
+char *_EXFUN(strsignal, (int __signo));
+#endif
+
+#endif /* _SYS_STRING_H */
+
+