Add a "COCCI" macro that we tell coccinelle is always defined.

This will let us give specific in-file equivalents to given macros
or preprocessor directives, to make things parse.
This commit is contained in:
Nick Mathewson
2019-10-09 10:07:50 -04:00
parent ea47e53252
commit a2bb66c355
2 changed files with 5 additions and 3 deletions
+1 -1
View File
@@ -6,4 +6,4 @@
top="$(dirname "$0")/../.."
spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
-I "$top" -I "$top"/src -I "$top"/ext "$@"
-I "$top" -I "$top"/src -I "$top"/ext --defined COCCI "$@"
+4 -2
View File
@@ -10,14 +10,16 @@ exitcode=0
for fn in "$@"; do
if spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
-I "$top" -I "$top"/src -I "$top"/ext --parse-c "$fn" \
-I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \
--parse-c "$fn" \
2>/dev/null | grep "perfect = 1" > /dev/null; then
: # it's perfect
else
echo "$fn"
if test "${VERBOSE}" != ""; then
spatch -macro_file_builtins "$top"/scripts/coccinelle/tor-coccinelle.h \
-I "$top" -I "$top"/src -I "$top"/ext --parse-c "$fn"
-I "$top" -I "$top"/src -I "$top"/ext --defined COCCI \
--parse-c "$fn"
fi
exitcode=1
fi