fixeria has uploaded this change for review. (
https://gerrit.osmocom.org/c/osmo-ci/+/26045 )
Change subject: scripts: add a script for checking presence of <endian.h>
......................................................................
scripts: add a script for checking presence of <endian.h>
Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6
---
A scripts/verify_endian_header.sh
1 file changed, 23 insertions(+), 0 deletions(-)
git pull ssh://gerrit.osmocom.org:29418/osmo-ci refs/changes/45/26045/1
diff --git a/scripts/verify_endian_header.sh b/scripts/verify_endian_header.sh
new file mode 100755
index 0000000..9dcbc0e
--- /dev/null
+++ b/scripts/verify_endian_header.sh
@@ -0,0 +1,23 @@
+#!/bin/sh
+
+# Usage: ./verify_endian_header.sh $(find . -name "*.[hc]")
+
+HEADER="osmocom/core/endian.h"
+COUNT=0
+
+for f in $*; do
+ # Obviously, ignore the header file defining the macros
+ if [ $(basename $f) = $(basename $HEADER) ]; then
+ continue
+ fi
+ # Match files using either of OSMO_IS_{LITTLE,BIG}_ENDIAN
+ if grep -q "OSMO_IS_\(LITTLE\|BIG\)_ENDIAN" $f; then
+ # The header file must be included
+ if ! grep -q "#include <$HEADER>" $f; then
+ echo "File '$f' does not #include <$HEADER>"
+ COUNT=$((COUNT + 1))
+ fi
+ fi
+done
+
+exit $COUNT
--
To view, visit https://gerrit.osmocom.org/c/osmo-ci/+/26045
To unsubscribe, or for help writing mail filters, visit
https://gerrit.osmocom.org/settings
Gerrit-Project: osmo-ci
Gerrit-Branch: master
Gerrit-Change-Id: I6a1e7fc2e96f42fc596f47b4d7f1ac6c61d834b6
Gerrit-Change-Number: 26045
Gerrit-PatchSet: 1
Gerrit-Owner: fixeria <[email protected]>
Gerrit-MessageType: newchange