Fixed Linux build not compiling.

This commit is contained in:
tschumann 2025-04-12 17:50:28 +10:00 committed by Nicholas Hastings
parent 99672c2f3f
commit 280ca9d826
3 changed files with 11 additions and 11 deletions

View File

@ -11,7 +11,7 @@
#define ENGINE_LIB_NAME "engine" LIB_SUFFIX
#endif
bool DetermineBackendS1(char *gameDir, int expectedBackend)
bool DetermineBackendS1(const char *gameDir, int expectedBackend)
{
char errorBuffer[128];
void *serverLib = nullptr;

View File

@ -20,13 +20,13 @@
} \
bool DetermineBackendS1(char *gameDir, int expectedBackend);
bool DetermineBackendS1(const char *gameDir, int expectedBackend);
DECL_TEST(TrimComments);
int main(int argc, char *argv[])
{
bool testDetermineBackendS1 = false;
char *gameDirectory = "";
char *gameDirectory = NULL;
int expectedMetamodBackend = -1;
for (int i = 0; i < argc; i++)
@ -47,8 +47,7 @@ int main(int argc, char *argv[])
if (testDetermineBackendS1)
{
bool success = DetermineBackendS1(gameDirectory, expectedMetamodBackend);
bool success = DetermineBackendS1(gameDirectory ? gameDirectory : "", expectedMetamodBackend);
// invert it because return code from main has 0 as success
return success != true;
}

View File

@ -20,10 +20,10 @@ class SteamGame {
[int]$ExpectedBackend
[bool]$Skip
SteamGame([string]$name, [string]$enginePath, [string]$gamePath, [string]$gameDir, [string]$architecture, [bool]$isDedicatedServer, [int]$expectedBackend, [bool]$skip) {
SteamGame([string]$name, [string]$enginePath, [string]$gamePath, [string]$gameDir, [string]$architecture, [bool]$isDedicatedServer, [int]$expectedBackend, [bool]$skip) {
$this.Name = $name
$this.EnginePath = $enginePath
$this.GamePath = $gamePath
$this.EnginePath = $enginePath
$this.GamePath = $gamePath
$this.GameDir = $gameDir
$this.Architecture = $architecture
$this.IsDedicatedServer = $isDedicatedServer
@ -40,7 +40,7 @@ if ($args.Count -ge 1)
$global:failureCount = 0
$gamesToTest = @{
alienswarm = [SteamGame]::new("Alien Swarm", "common\Alien Swarm\bin", "common\Alien Swarm\swarm\bin", "swarm", "x86", $false, 9, $true)
alienswarm = [SteamGame]::new("Alien Swarm", "common\Alien Swarm\bin", "common\Alien Swarm\swarm\bin", "swarm", "x86", $false, 9, $true)
blackmesa = [SteamGame]::new("Black Mesa", "common\Black Mesa\bin", "common\Black Mesa\bms\bin", "bms", "x86", $false, 21, $false)
bladesymphony_32 = [SteamGame]::new("Blade Symphony (x86)", "common\Blade Symphony\bin\win32", "", "berimbau", "x86", $false, 18, $false)
bladesymphony_64 = [SteamGame]::new("Blade Symphony (x64)", "common\Blade Symphony\bin\win64", "", "berimbau", "x64", $false, 18, $false)
@ -75,7 +75,7 @@ $gamesToTest = @{
function testGame([SteamGame]$game)
{
Write-Host @("Testing", $game.Name) -ForegroundColor yellow
Write-Host @("Testing", $game.Name) -ForegroundColor yellow
$steamappsPath = "${steamPath}\steamapps"
$enginePath = "${steamappsPath}\" + $game.EnginePath
@ -95,6 +95,7 @@ function testGame([SteamGame]$game)
Return
}
# make gamedir the last parameter as something weird is going on where if it's "" then PowerShell is collapsing it and the next argument gets passed as gamedir
if ($game.Architecture -eq "x86")
{
$env:Path=$enginePath + ";" + $gamePath + ";" + $env:Path; ..\..\build\loader\test\test_loader\windows-x86\test_loader.exe -testdbs1 -expectedbackend $game.ExpectedBackend -gamedir $game.GameDir
@ -125,7 +126,7 @@ function testGame([SteamGame]$game)
foreach ($game in $gamesToTest.Keys | Sort-Object)
{
testGame $gamesToTest[$game]
testGame $gamesToTest[$game]
}
Write-Host "There were ${global:failureCount} failures"