summaryrefslogtreecommitdiffstats
path: root/tools/build/packhex.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1998-01-21 18:28:09 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1998-01-21 18:28:09 +0000
commit9ad1f135fafcca1d43766dc928e50e4de201614c (patch)
treed5f4890c13c84ed691264e62101e6eecc9e46831 /tools/build/packhex.c
parentd73ed76b03671198b0a73994beef019943746338 (diff)
downloadrtems-9ad1f135fafcca1d43766dc928e50e4de201614c.tar.bz2
Added autoconf support for strerror/sys_errlist per Ralf Corsepius'
direction. This fixes a problem reported by Steve Evans of Radstone since he is using glibc2.
Diffstat (limited to '')
-rw-r--r--tools/build/packhex.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tools/build/packhex.c b/tools/build/packhex.c
index 6410b520c6..aa92761a91 100644
--- a/tools/build/packhex.c
+++ b/tools/build/packhex.c
@@ -37,6 +37,23 @@
#include <stdlib.h>
#include <string.h>
+#include "config.h"
+
+#ifndef VMS
+#ifndef HAVE_STRERROR
+extern int sys_nerr;
+extern char *sys_errlist[];
+
+#define strerror( _err ) \
+ ((_err) < sys_nerr) ? sys_errlist [(_err)] : "unknown error"
+
+#else /* HAVE_STRERROR */
+char *strerror ();
+#endif
+#else /* VMS */
+char *strerror (int,...);
+#endif
+
#if defined(__unix__) && !defined(EXIT_FAILURE)
#define EXIT_FAILURE -1
#define EXIT_SUCCESS 0