4 echo "usage: sztest [-hab] [-H SYS-HEADER] [-L LOCAL-HEADER] TYPE [CCFLAGS...]"
10 while [ "${1:0:1}" = "-" ]; do
25 sheaders="$sheaders $1"
29 lheaders="$lheaders $1"
40 file="$(mktemp /tmp/sztestXXXXXX)"
44 #include <sys/types.h>
48 for header in $sheaders; do
49 echo "#include <$header>" >>"$file.c"
51 for header in $lheaders; do
52 echo "#include \"$header\"" >>"$file.c"
55 int main(int argc, char **argv)
60 echo " printf(\"%zi\\n\", sizeof($type));" >>"$file.c"
63 echo " printf(\"%zi\\n\", __alignof__($type));" >>"$file.c"
66 echo " printf(\"%zi %zi\\n\", sizeof($type), __alignof__($type));" >>"$file.c"
74 if ! gcc "$@" -iquote. -g -Wall -o "$file" "$file.c"; then
75 rm -f "$file" "$file.c"