6 awk -F'\t' '$3 ~ /^[sut]$/ {
8 }' data/musl.tags >/tmp/m.type
9 echo 'wchar_t' >>/tmp/m.type
13 find . -name '*.h' | sed 's,^\./,,' >/tmp/m.header
16 echo '#define _GNU_SOURCE 1' >sizeof.c
17 echo '#define _LARGEFILE64_SOURCE 1' >>sizeof.c
18 echo '#define _FILE_OFFSET_BITS 64' >>sizeof.c
19 echo '#include <stddef.h>' >>sizeof.c
20 echo '#include <sys/types.h>' >>sizeof.c
23 sort /tmp/m.header |uniq |awk '
24 /^features\.h$/ { printf "//" }
25 { print "#include <" $0 ">" }' >>sizeof.c
26 echo '#define p(x) printf("%s\\t%u\\n", #x, sizeof(x));' >>sizeof.c
27 echo 'int main(){' >>sizeof.c
28 sed 's/.*/p(&)/' /tmp/m.type |awk '
32 /p\(struct __CODE\)/ ||
33 /p\(struct __fpstate\)/ ||
34 /p\(struct __ptcb\)/ ||
35 /p\(struct __siginfo\)/ ||
36 /p\(struct __ucontext\)/ ||
37 /p\(struct in6_mutinfo\)/ ||
38 /p\(struct npttimeval\)/ { printf "//" }
40 echo 'return 0;}' >>sizeof.c