Speculatively unbreak Windows build
authorDavid Majnemer <david.majnemer@gmail.com>
Thu, 15 Oct 2015 09:17:15 +0000 (09:17 +0000)
committerDavid Majnemer <david.majnemer@gmail.com>
Thu, 15 Oct 2015 09:17:15 +0000 (09:17 +0000)
<windows.h> defines macros named min and max in conflict with
<algorithm>.  Prevent macro expansion by wrapping std::min in
parenthesis.

git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@250383 91177308-0d34-0410-b5e6-96231b3b80d8

tools/llvm-pdbdump/llvm-pdbdump.cpp

index 5b5cf00956cc90094f1836ba97143774b6678ec0..7af8c5fe352f8223c36452ee859bdc862faa3c67 100644 (file)
@@ -361,8 +361,8 @@ static void dumpStructure(MemoryBufferRef M) {
       if (BytesLeftToReadInStream == 0)
         break;
 
-      uint32_t BytesToReadInBlock =
-          std::min(BytesLeftToReadInStream, static_cast<uint32_t>(SB->BlockSize));
+      uint32_t BytesToReadInBlock = (std::min)(
+          BytesLeftToReadInStream, static_cast<uint32_t>(SB->BlockSize));
       auto StreamBlockData =
           StringRef(M.getBufferStart() + StreamBlockOffset, BytesToReadInBlock);
       if (auto EC = checkOffset(M, StreamBlockData))