Commit e051c631 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

check_headers: fix regular expression

parent e2067626
...@@ -5,14 +5,23 @@ cd "$(dirname "$0")" || exit $? ...@@ -5,14 +5,23 @@ cd "$(dirname "$0")" || exit $?
# Look for configure #defines in public headers. # Look for configure #defines in public headers.
# There are incorrect, as external users don't have our <config.h>. # There are incorrect, as external users don't have our <config.h>.
regexp="$(cat ../config.h.in | \ regexp=""
sed -n -e 's/^#undef \([[:upper:][:digit:]_]*\)$/\1/p' | \
grep -v 'WORDS_BIGENDIAN' | \ while read l; do
grep -v 'UNICODE' | \ d=$(echo "$l" | sed -n -e 's/^#undef \([[:upper:][:digit:]_]*\)$/\1/p')
grep -v '__LIBVLC__' | \ test -z "$d" && continue
xargs | \ test "$d" = "WORDS_BIGENDIAN" && continue
sed -e 's/ /\\\(\\s\\\|$\\\)\\\| /g')" test "$d" = "UNICODE" && continue
regexp=" $regexp\$" test "$d" = "__LIBVLC__" && continue
if test -z "$regexp"; then
regexp="[^A-Za-z0-9_]\("
else
regexp="${regexp}\|"
fi
regexp="${regexp}${d}"
done < ../config.h.in
regexp="${regexp}\)\([^A-Za-z0-9_]\|\$\)"
echo Looking for private defines in public headers... echo Looking for private defines in public headers...
! grep -- "$regexp" "$@" || exit $? ! grep -- "$regexp" "$@" || exit $?
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment