From 1b66a6cb98115366fde7aafb6a390cb520c3e0e9 Mon Sep 17 00:00:00 2001 From: Jakob Kaivo Date: Mon, 15 Jul 2019 11:46:17 -0400 Subject: use C99 designated initializers --- Makefile | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'Makefile') 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 \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' >> $@ -- cgit v1.2.1