From 8254d8cf9b34650f86ea11280d0eb8967dfd9739 Mon Sep 17 00:00:00 2001 From: Derek Mauro Date: Wed, 15 Oct 2025 10:01:47 -0700 Subject: [PATCH] Avoid redefine warnings with ntstatus constants Fixes #1952 PiperOrigin-RevId: 819802635 Change-Id: Ic5ccc1ce61906afbf4ab9e0045b0f54ddaf3be9b --- absl/debugging/symbolize_win32.inc | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/absl/debugging/symbolize_win32.inc b/absl/debugging/symbolize_win32.inc index 589890f3..eaeefb98 100644 --- a/absl/debugging/symbolize_win32.inc +++ b/absl/debugging/symbolize_win32.inc @@ -15,7 +15,6 @@ // See "Retrieving Symbol Information by Address": // https://msdn.microsoft.com/en-us/library/windows/desktop/ms680578(v=vs.85).aspx -#include #include #include @@ -58,10 +57,9 @@ void InitializeSymbolizer(const char*) { // NTSTATUS (0xC0000004), which can happen when a module load occurs during // the SymInitialize call. In this case, we should try calling SymInitialize // again. + constexpr DWORD kStatusInfoLengthMismatch = DWORD{0xC0000004}; syminitialize_error = GetLastError(); - // Both NTSTATUS and DWORD are 32-bit numbers, which makes the cast safe. - if (syminitialize_error != - static_cast(STATUS_INFO_LENGTH_MISMATCH)) { + if (syminitialize_error != kStatusInfoLengthMismatch) { break; } }