mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
src: avoid unused variable 'error' warning
The variable is only used in DEBUG mode. Define it only in that case. PR-URL: https://github.com/nodejs/node/pull/52886 Reviewed-By: Moshe Atlow <moshe@atlow.co.il> Reviewed-By: Richard Lau <rlau@redhat.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com>
This commit is contained in:
parent
a923fed874
commit
e03529ec27
@ -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;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user