Systemd/src/udev/generate-keyboard-keys-gperf.sh
Shawn Landden 4831981d89 tree-wide: adjust fall through comments so that gcc is happy
Distcc removes comments, making the comment silencing
not work.

I know there was a decision against a macro in commit
ec251fe7d5
2017-11-20 13:06:25 -08:00

16 lines
434 B
Bash
Executable file

#!/bin/sh -eu
awk ' BEGIN {
print "%{\n\
#if __GNUC__ >= 7\n\
_Pragma(\"GCC diagnostic ignored \\\"-Wimplicit-fallthrough\\\"\")\n\
#endif\n\
%}"
print "struct key_name { const char* name; unsigned short id; };"
print "%null-strings"
print "%%"
}
/^KEY_/ { print tolower(substr($1 ,5)) ", " $1 }
{ print tolower($1) ", " $1 }
' < "$1"