summaryrefslogtreecommitdiff
path: root/Makefile
diff options
context:
space:
mode:
authorJakob Kaivo <jkk@ung.org>2019-07-15 11:46:17 -0400
committerJakob Kaivo <jkk@ung.org>2019-07-15 11:46:17 -0400
commit1b66a6cb98115366fde7aafb6a390cb520c3e0e9 (patch)
treef94a139ee3a332338b5a75c30885c54dd6e34b73 /Makefile
parent8d760d357061d7111455195fcd8de11f8f38c21b (diff)
use C99 designated initializers
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' >> $@