Guard autoupdater more completely

This commit is contained in:
Tim Angus 2025-11-02 14:03:42 +00:00
parent 76043c78b9
commit a9a6ccb103
3 changed files with 20 additions and 21 deletions

View File

@ -17,13 +17,10 @@ is licensed under the GPLv2. Do not mingle code, please!
# include <stdio.h>
# include <string.h>
#endif
void Sys_LaunchAutoupdater(int argc, char **argv)
{
#ifdef USE_AUTOUPDATER
#ifdef _WIN32
{
/* We don't need the Unix pipe() tapdance here because Windows lets children wait on parent processes. */
PROCESS_INFORMATION procinfo;
STARTUPINFO startinfo;
@ -39,7 +36,6 @@ void Sys_LaunchAutoupdater(int argc, char **argv)
CloseHandle(procinfo.hProcess);
CloseHandle(procinfo.hThread);
}
}
#else
int updater_pipes[2];
if (pipe(updater_pipes) == 0)
@ -79,8 +75,6 @@ void Sys_LaunchAutoupdater(int argc, char **argv)
}
}
#endif
#endif
(void) argc; (void) argv; /* possibly unused. Pacify compilers. */
}
#endif /* USE_AUTOUPDATER */

View File

@ -73,3 +73,7 @@ qboolean Sys_OpenFolderInPlatformFileManager( const char *path );
#ifdef PROTOCOL_HANDLER
char *Sys_ParseProtocolUri( const char *uri );
#endif
#ifdef USE_AUTOUPDATER
void Sys_LaunchAutoupdater(int argc, char **argv);
#endif

View File

@ -790,8 +790,9 @@ int main( int argc, char **argv )
char *protocolCommand = NULL;
#endif
extern void Sys_LaunchAutoupdater(int argc, char **argv);
#ifdef USE_AUTOUPDATER
Sys_LaunchAutoupdater(argc, argv);
#endif
#ifndef DEDICATED
// SDL version check