diff options
| author | Jakob Kaivo <jkk@ung.org> | 2019-07-15 11:46:17 -0400 |
|---|---|---|
| committer | Jakob Kaivo <jkk@ung.org> | 2019-07-15 11:46:17 -0400 |
| commit | 1b66a6cb98115366fde7aafb6a390cb520c3e0e9 (patch) | |
| tree | f94a139ee3a332338b5a75c30885c54dd6e34b73 /Makefile | |
| parent | 8d760d357061d7111455195fcd8de11f8f38c21b (diff) | |
use C99 designated initializers
Diffstat (limited to 'Makefile')
| -rw-r--r-- | Makefile | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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' >> $@ |
