diff --git a/src/debug_utils.cc b/src/debug_utils.cc index 82e6587016ed3a..9d36082db672ce 100644 --- a/src/debug_utils.cc +++ b/src/debug_utils.cc @@ -182,10 +182,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { return NameAndDisplacement(pSymbol->Name, dwDisplacement); } else { // SymFromAddr failed - const DWORD error = GetLastError(); // "eat" the error anyway #ifdef DEBUG + const DWORD error = GetLastError(); fprintf(stderr, "SymFromAddr returned error : %lu\n", error); -#endif +#else + // Consume the error anyway + USE(GetLastError()); +#endif // DEBUG } // End MSDN code @@ -217,10 +220,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { sym.line = line.LineNumber; } else { // SymGetLineFromAddr64 failed - const DWORD error = GetLastError(); // "eat" the error anyway #ifdef DEBUG + const DWORD error = GetLastError(); fprintf(stderr, "SymGetLineFromAddr64 returned error : %lu\n", error); -#endif +#else + // Consume the error anyway + USE(GetLastError()); +#endif // DEBUG } // End MSDN code @@ -240,10 +246,13 @@ class Win32SymbolDebuggingContext final : public NativeSymbolDebuggingContext { return szUndName; } else { // UnDecorateSymbolName failed - const DWORD error = GetLastError(); // "eat" the error anyway #ifdef DEBUG + const DWORD error = GetLastError(); fprintf(stderr, "UnDecorateSymbolName returned error %lu\n", error); -#endif +#else + // Consume the error anyway + USE(GetLastError()); +#endif // DEBUG } return nullptr; }