Skip to content

Commit 836210b

Browse files
committed
ENH: Removing circular header includes
Break recursive inclusion of the .h files from the .hxx files. This should avoid reading the .h file multiple times.
1 parent d75910d commit 836210b

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
#!/bin/bash
2+
# This script finds cases where .hxx files include same named
3+
# .h file, which results in recursive inclusion of the .h.
4+
5+
SRC_DIR=$1
6+
if [ ! -d "${SRC_DIR}" ]; then
7+
echo "ERROR: Directory not found ${SRC_DIR}"
8+
fi
9+
10+
11+
for hdr_imp in $(find "${SRC_DIR}" -name "*.hxx" |grep -F -v ThirdParty ); do
12+
hdr_imp_base=$(basename "${hdr_imp}")
13+
hdr_base=${hdr_imp_base//.hxx/.h}
14+
sed -i "/ *#include.*${hdr_base}./d" "${hdr_imp}"
15+
done

0 commit comments

Comments
 (0)