[llvm] r201230 - Windows/Path.inc: Move <shlobj.h> after "Windows.h" for some API available.

NAKAMURA Takumi geek4civic at gmail.com
Wed Feb 12 03:50:22 PST 2014

Author: chapuni
Date: Wed Feb 12 05:50:22 2014
New Revision: 201230

URL: http://llvm.org/viewvc/llvm-project?rev=201230&view=rev
Windows/Path.inc: Move <shlobj.h> after "Windows.h" for some API available.

  I found that swapping the order of some header files helped fix a
  build issue that we're seeing on mingw32. Without the swap, windows.h
  was being included before _WIN32_WINNT was being defined and the
  CreateHardLinkW function was #ifdef'd out.

  It looks like the header is mainly used to get the SHGetFolderPathW
  function, so I don't think that there'll be much fallout from the

Suggested by Alex Crichton. Thanks!


Modified: llvm/trunk/lib/Support/Windows/Path.inc
URL: http://llvm.org/viewvc/llvm-project/llvm/trunk/lib/Support/Windows/Path.inc?rev=201230&r1=201229&r2=201230&view=diff
--- llvm/trunk/lib/Support/Windows/Path.inc (original)
+++ llvm/trunk/lib/Support/Windows/Path.inc Wed Feb 12 05:50:22 2014
@@ -19,12 +19,13 @@
 #include "llvm/ADT/STLExtras.h"
 #include <fcntl.h>
 #include <io.h>
-#include <shlobj.h>
 #include <sys/stat.h>
 #include <sys/types.h>
-// The Windows.h header must be the last one included.
+// These two headers must be included last, and make sure shlobj is required
+// after Windows.h to make sure it picks up our definition of _WIN32_WINNT
 #include "Windows.h"
+#include <shlobj.h>
 #undef max

More information about the llvm-commits mailing list