summaryrefslogtreecommitdiffstats
path: root/tools/sort-headers.py
diff options
context:
space:
mode:
authorthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 01:53:06 +0000
committerthakis@chromium.org <thakis@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2011-05-20 01:53:06 +0000
commit51e3da5bc276c87ca2c28e8436abbbe47e674979 (patch)
tree1fa831cceef90ae148b8959fe086f1af13b9ab02 /tools/sort-headers.py
parent0a0d6cc68ed093cd31e1ebd4fedb453f7b6df127 (diff)
downloadchromium_src-51e3da5bc276c87ca2c28e8436abbbe47e674979.zip
chromium_src-51e3da5bc276c87ca2c28e8436abbbe47e674979.tar.gz
chromium_src-51e3da5bc276c87ca2c28e8436abbbe47e674979.tar.bz2
Teach sort-headers.py about unknwn.h
BUG=none TEST=none Review URL: http://codereview.chromium.org/7047026 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@86035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools/sort-headers.py')
-rwxr-xr-xtools/sort-headers.py13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/sort-headers.py b/tools/sort-headers.py
index 34bfeae..e51343c 100755
--- a/tools/sort-headers.py
+++ b/tools/sort-headers.py
@@ -39,10 +39,15 @@ def IncludeCompareKey(line):
if line.startswith(prefix):
line = line[len(prefix):]
break
- # <windows.h> needs to be before other includes, so return a key
- # that's less than all other keys.
- if line.lstrip().startswith('<windows.h>'):
- return ''
+
+ # The win32 api has all sorts of implicit include order dependencies :-/
+ # Give a few headers special sort keys that make sure they appear before all
+ # other headers.
+ if line.startswith('<windows.h>'): # Must be before e.g. shellapi.h
+ return '0'
+ if line.startswith('<unknwn.h>'): # Must be before e.g. intshcut.h
+ return '1'
+
return line