summaryrefslogtreecommitdiffstats
path: root/js/src/zydis/patch-include-headers.sh
blob: f3c5ac31cc5855a13226f1ddbab9029a52ca10a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/bin/sh
for fn in `find . -name '*.[hc]'`
do
    gawk '
{ if (match($0, /( *# *include +)<(Zy.*ExportConfig.h|Zy(dis|core).*\.h)>/, res)) {
    print res[1] "\"zydis/" res[2] "\""
    next
  } else if (match($0, /( *# *include +)<(Generated\/.*\.inc)>/, res)) {
    print res[1] "\"zydis/Zydis/" res[2] "\""
    next
  }
  print $0 }' $fn > $fn.bak
    mv $fn.bak $fn
done