Fix build: rename GetLastError to avoid Win32 collision, fix strprintf varargs
- Rename CTorProcess::GetLastError() and CTorEmbedded::GetLastError() to GetStartupError() so they don't shadow the Win32 GetLastError() API, which caused a std::string-to-DWORD conversion error on Windows. - Qualify the one Win32 call as ::GetLastError() for clarity. - Pass torError.c_str() to strprintf instead of std::string, fixing Clang's -Wnon-pod-varargs error on macOS. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
@@ -314,7 +314,7 @@ bool CTorProcess::Start(const std::string& dataDir, int socks, int hsPort, bool
|
||||
NULL, NULL,
|
||||
&si, &pi))
|
||||
{
|
||||
DWORD err = GetLastError();
|
||||
DWORD err = ::GetLastError();
|
||||
lastError = strprintf("CreateProcess failed for Tor binary '%s' with Windows error %lu", torBinaryPath.c_str(), err);
|
||||
printf("ERROR: Failed to start Tor process (error %lu)\n", err);
|
||||
return false;
|
||||
|
||||
Reference in New Issue
Block a user