summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
Diffstat (limited to 'Makefile')
-rw-r--r--Makefile5
1 files changed, 3 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index a5faec4..0370909 100644
--- a/Makefile
+++ b/Makefile
@@ -3,6 +3,7 @@ strerror: strerror.c strerror.h
strerror.h: errlist Makefile
printf '#ifndef STRERROR_H\n#define STRERROR_H 1\n\n' > $@
- printf 'struct { int number; char *name; } errlist[] = {\n' >> $@
- awk '{printf("#ifdef %s\n\t{ %s,\t\"%s\" },\n#endif\n", $$0, $$0, $$0);}' errlist >> $@
+ printf '#include <errno.h>\n\n' >> $@
+ printf 'const char *errlist[] = {\n' >> $@
+ awk '{printf("#ifdef %s\n\t[%s] = \"%s\",\n#endif\n", $$0, $$0, $$0);}' errlist >> $@
printf '};\n\n#endif\n' >> $@