Add missing include file - include what you use
base_paths_win.cc needs the known folders GUIDs which are defined in KnownFolders.h. It was including shlobj.h which *usually* brings in this header file, but not always. The happy path is: shlobj.h includes shlobj_core.h which includes shlguid.h which includes KnownFolders.h However shlobj_core.h includes shlguid.h like this: #ifndef INITGUID #include <shlguid.h> #endif /* !INITGUID */ That's fine if shlguid.h is the only place that defines INITGUID, but it isn't. It doesn't even define it - it includes another file that does. That's terrible. So, if you include shlobj.h you may or may not get KnownFolders.h. This is sloppy on our part, and on Microsoft's. This was found while experimenting with different jumbo-build settings - FOLDERID_ApplicationShortcuts would not be defined if the wrong .cc files were included first. The investigation was done by compiling with /showIncludes to find out why KnownFolders.h was sometimes included, and then find out why it wasn't always. The bug in shlobj_core.h was reported here: https://developercommunity.visualstudio.com/content/problem/162527/shlguidh-is-incorrectly-included-by-shlobj-coreh.html Change-Id: I57f7894a7016704d15d5b02bbcf518b318263db2 Reviewed-on: https://chromium-review.googlesource.com/813017 Commit-Queue: Bruce Dawson <brucedawson@chromium.org> Reviewed-by:Lei Zhang <thestig@chromium.org> Cr-Commit-Position: refs/heads/master@{#522463}
Showing
Please register or sign in to comment