is there a rule that <windows.h> needs to be included before any other
win32 api headers? If I move it below the shellapi.h include in
base/file_util_unittest.cc I get several compile errors, which
suggests that the win32 api include order has some implicit rules, but
there are some files that include win32 api headers before they
include windows.h.
The reason I'm asking is that we have a script that sorts include
files (tools/sort-headers.py), and I'd like to fix that script so that
it doesn't produce output that doesn't compile. Is "put windows.h
first in the include block it's in" ok? Are there other implicit
ordering dependencies for windows headers?
Thanks,
Nico
--
Chromium Developers mailing list: [email protected]
View archives, change email options, or unsubscribe:
http://groups.google.com/a/chromium.org/group/chromium-dev
is there a rule that <windows.h> needs to be included before any other
win32 api headers?
Are there other implicit
ordering dependencies for windows headers?
Bummer. The only way is to add these on a case-by-case basis then I guess? :-/
Another dependency apparently is that <unknwn.h> needs to come before
<intshcut.h> (http://codereview.chromium.org/7048007/diff/8001/chrome/browser/importer/importer_unittest.cc
, http://build.chromium.org/p/tryserver.chromium/builders/win/builds/32426/steps/compile/logs/stdio#error1
)
> PK
FWIW, this is why sort-headers.py prompts you before committing to a
reordering -- the comment in that file (that the header order is
important) will show up in the diff. You can then just edit these
exceptional files by hand if necessary.