Add check for HB_EXTERNs

https://github.com/behdad/harfbuzz/pull/555
This commit is contained in:
Behdad Esfahbod 2017-10-07 12:56:53 +02:00
parent 48a9406839
commit c2545b9215
2 changed files with 22 additions and 0 deletions

View File

@ -300,6 +300,7 @@ check: harfbuzz.def # For check-defs.sh
dist_check_SCRIPTS = \ dist_check_SCRIPTS = \
check-c-linkage-decls.sh \ check-c-linkage-decls.sh \
check-defs.sh \ check-defs.sh \
check-externs.sh \
check-header-guards.sh \ check-header-guards.sh \
check-includes.sh \ check-includes.sh \
check-libstdc++.sh \ check-libstdc++.sh \

21
src/check-externs.sh Executable file
View File

@ -0,0 +1,21 @@
#!/bin/sh
LC_ALL=C
export LC_ALL
test -z "$srcdir" && srcdir=.
stat=0
test "x$HBHEADERS" = x && HBHEADERS=`cd "$srcdir"; find . -maxdepth 1 -name 'hb*.h'`
test "x$EGREP" = x && EGREP='grep -E'
echo 'Checking that all public symbols are exported with HB_EXTERN'
for x in $HBHEADERS; do
test -f "$srcdir/$x" && x="$srcdir/$x"
$EGREP -B1 '^hb_' "$x" | $EGREP -E -v '^(--|hb_|HB_EXTERN )' -A1
done |
grep . >&2 && stat=1
exit $stat