generate-af-list.sh: slightly generalize pattern, fix w/musl (#8629)
authorWill Dietz <github@wdtz.org>
Sat, 31 Mar 2018 10:55:45 +0000 (05:55 -0500)
committerLennart Poettering <lennart@poettering.net>
Sat, 31 Mar 2018 10:55:45 +0000 (12:55 +0200)
Accept definitions to other AF_ constants, not just PF_ ones,
such as:

  #define AF_LINUX AF_LOCAL

It may not be necessary to impose any restriction on the
definitions of the macros extracted, but for now
keep most of that requirement but match AF_* as well.

src/basic/generate-af-list.sh

index fa74198..39e2dad 100755 (executable)
@@ -3,4 +3,4 @@ set -eu
 
 $1 -E -dM -include sys/socket.h - </dev/null | \
         grep -Ev 'AF_UNSPEC|AF_MAX' | \
-        awk '/^#define[ \t]+AF_[^ \t]+[ \t]+PF_[^ \t]/ { print $2; }'
+        awk '/^#define[ \t]+AF_[^ \t]+[ \t]+[AP]F_[^ \t]/ { print $2; }'