summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 18:24:38 +0000
committerasvitkine@chromium.org <asvitkine@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2012-01-05 18:24:38 +0000
commit0807909bde1497cfa79259cf495707916ab55995 (patch)
tree3310231b578e7ab28b8d36f19193a65e09160fe1 /tools
parent61fd4dc472f8990d53b6773d98ef9c090dc33789 (diff)
downloadchromium_src-0807909bde1497cfa79259cf495707916ab55995.zip
chromium_src-0807909bde1497cfa79259cf495707916ab55995.tar.gz
chromium_src-0807909bde1497cfa79259cf495707916ab55995.tar.bz2
Make ./tools/sort-headers.py order C++ system headers before C system headers.
BUG=none TEST=manual Review URL: http://codereview.chromium.org/9109013 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@116513 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rwxr-xr-xtools/sort-headers.py11
1 files changed, 9 insertions, 2 deletions
diff --git a/tools/sort-headers.py b/tools/sort-headers.py
index 168dfce..49ace80 100755
--- a/tools/sort-headers.py
+++ b/tools/sort-headers.py
@@ -1,5 +1,5 @@
#!/usr/bin/env python
-# Copyright (c) 2011 The Chromium Authors. All rights reserved.
+# Copyright (c) 2012 The Chromium Authors. All rights reserved.
# Use of this source code is governed by a BSD-style license that can be
# found in the LICENSE file.
@@ -50,7 +50,14 @@ def IncludeCompareKey(line):
if line.startswith('<unknwn.h>'): # Must be before e.g. intshcut.h
return '1'
- return line
+ # C++ system headers should come after C system headers.
+ if line.startswith('<'):
+ if line.find('.h>') != -1:
+ return '2' + line
+ else:
+ return '3' + line
+
+ return '4' + line
def IsInclude(line):