diff --git a/include/spdk/stdinc.h b/include/spdk/stdinc.h index 9f473606ba..586a94f567 100644 --- a/include/spdk/stdinc.h +++ b/include/spdk/stdinc.h @@ -72,6 +72,7 @@ extern "C" { #include #include #include +#include #include #include #include diff --git a/lib/net/interface.c b/lib/net/interface.c index e7125607cf..de9cb4f436 100644 --- a/lib/net/interface.c +++ b/lib/net/interface.c @@ -42,8 +42,6 @@ #include #include -#include - static TAILQ_HEAD(, spdk_interface) g_interface_head; diff --git a/scripts/check_format.sh b/scripts/check_format.sh index a4dd1fdad7..ec128f45b7 100755 --- a/scripts/check_format.sh +++ b/scripts/check_format.sh @@ -62,6 +62,17 @@ else fi rm -f eofnl.log +echo -n "Checking for POSIX includes..." +git grep -I -i -f scripts/posix.txt -- './*' ':!include/spdk/stdinc.h' ':!lib/vhost/rte_vhost/**' ':!scripts/posix.txt' > scripts/posix.log || true +if [ -s scripts/posix.log ]; then + echo "POSIX includes detected. Please include spdk/stdinc.h instead." + cat scripts/posix.log + rc=1 +else + echo " OK" +fi +rm -f scripts/posix.log + if hash pep8; then echo -n "Checking Python style..." diff --git a/scripts/posix.txt b/scripts/posix.txt new file mode 100644 index 0000000000..2d07f23df5 --- /dev/null +++ b/scripts/posix.txt @@ -0,0 +1,82 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +