Protect "std::max", "std::min" against MACROs defined in WinDef.h.

git-svn-id: http://google-breakpad.googlecode.com/svn/trunk@780 4c0a9323-5329-0410-9bdc-e9ce6186880e
This commit is contained in:
SiyangXie@gmail.com 2011-03-11 22:47:07 +00:00
parent fd18beeb5c
commit 88fa7cfc6b

View file

@ -793,11 +793,11 @@ bool ExceptionHandler::WriteMinidumpWithException(
// pointer, but settle for whatever's available up to the // pointer, but settle for whatever's available up to the
// boundaries of the memory region. // boundaries of the memory region.
const ULONG64 kIPMemorySize = 256; const ULONG64 kIPMemorySize = 256;
context.memory_base = context.memory_base =
std::max(reinterpret_cast<ULONG64>(info.BaseAddress), (std::max)(reinterpret_cast<ULONG64>(info.BaseAddress),
instruction_pointer - (kIPMemorySize / 2)); instruction_pointer - (kIPMemorySize / 2));
ULONG64 end_of_range = ULONG64 end_of_range =
std::min(instruction_pointer + (kIPMemorySize / 2), (std::min)(instruction_pointer + (kIPMemorySize / 2),
reinterpret_cast<ULONG64>(info.BaseAddress) reinterpret_cast<ULONG64>(info.BaseAddress)
+ info.RegionSize); + info.RegionSize);
context.memory_size = context.memory_size =