Skip to content

Commit

Permalink
Update include guard fix script
Browse files Browse the repository at this point in the history
  • Loading branch information
Grumbel committed Oct 23, 2018
1 parent 6b831a1 commit 145fd8d
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions tools/fix_include_guards.sh
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
#!/bin/sh

for i in "$@"; do
echo $i
NAME=$(echo $i | sed "s/[\/\.]/_/g;s/^/HEADER_SUPERTUX_/" | tr [a-z] [A-Z])
sed -i "s/^#ifndef .*_H_\$/#ifndef $NAME/" $i;
sed -i "s/^#define .*_H_\$/#define $NAME/" $i;
NAME=$(echo $i | sed "s/[\/\.]/_/g;s/^/SUPERTUX_/" | tr [a-z] [A-Z])
echo $i $NAME
sed -i "s/^#ifndef HEADER_.*/#ifndef HEADER_$NAME/" $i;
sed -i "s/^#define HEADER_.*/#define HEADER_$NAME/" $i;
done

# EOF #

0 comments on commit 145fd8d

Please sign in to comment.