fix build error on script engine refactor for Linux

This commit is contained in:
sina 2026-06-02 19:51:27 +02:00
parent 757738bf23
commit ffb0f8ac1d
4 changed files with 25 additions and 5 deletions

View file

@ -9,7 +9,11 @@
* @copyright This project is released under the GNU Public License v3.
*
*/
#include "platform/user/header/platform-lib-calls.h"
#include "pch.h"
#if defined(__linux__)
# include "../header/platform-lib-calls.h"
#endif // defined(__linux__)
/**
* @brief Platform independent wrapper for vsprintf_s / vsnprintf
@ -28,7 +32,7 @@ PlatformVsnprintf(char * Buffer, SIZE_T BufferSize, const char * Format, va_list
#elif defined(__linux__)
return vsnprintf(Buffer, BufferSize, Format, ArgList);
#else
# error "Unsupported platform"
# error "Unsupported platform"
#endif
}
@ -46,7 +50,7 @@ PlatformStrDup(const char * Str)
#elif defined(__linux__)
return strdup(Str);
#else
# error "Unsupported platform"
# error "Unsupported platform"
#endif
}
@ -64,6 +68,6 @@ PlatformZeroMemory(PVOID Buffer, SIZE_T Size)
#elif defined(__linux__)
memset(Buffer, 0, Size);
#else
# error "Unsupported platform"
# error "Unsupported platform"
#endif
}

View file

@ -30,7 +30,7 @@
// Windows Header Files
//
#ifdef _WIN32
#include <windows.h>
# include <windows.h>
#endif
#include <ctype.h>
@ -54,6 +54,11 @@
#include "parse-table.h"
#include "hardware.h"
//
// Platform-specific library calls
//
#include "platform/user/header/platform-lib-calls.h"
//
// Import/export definitions
//

View file

@ -128,6 +128,7 @@ exit /b 0
</PostBuildEvent>
</ItemDefinitionGroup>
<ItemGroup>
<ClInclude Include="..\include\platform\user\header\platform-lib-calls.h" />
<ClInclude Include="header\common.h" />
<ClInclude Include="header\globals.h" />
<ClInclude Include="header\hardware.h" />
@ -139,6 +140,7 @@ exit /b 0
<ClInclude Include="header\type.h" />
</ItemGroup>
<ItemGroup>
<ClCompile Include="..\include\platform\user\code\platform-lib-calls.c" />
<ClCompile Include="code\common.c" />
<ClCompile Include="code\globals.c" />
<ClCompile Include="code\hardware.c" />

View file

@ -12,6 +12,9 @@
<Filter Include="header\platform">
<UniqueIdentifier>{53ae7bcb-e612-4a1a-89db-de1e77f2d730}</UniqueIdentifier>
</Filter>
<Filter Include="code\platform">
<UniqueIdentifier>{45bab125-0b6b-4791-bb0e-eace92a93baa}</UniqueIdentifier>
</Filter>
</ItemGroup>
<ItemGroup>
<ClInclude Include="header\common.h">
@ -41,6 +44,9 @@
<ClInclude Include="header\script_include.h">
<Filter>header</Filter>
</ClInclude>
<ClInclude Include="..\include\platform\user\header\platform-lib-calls.h">
<Filter>header\platform</Filter>
</ClInclude>
</ItemGroup>
<ItemGroup>
<ClCompile Include="code\common.c">
@ -70,5 +76,8 @@
<ClCompile Include="code\script_include.c">
<Filter>code</Filter>
</ClCompile>
<ClCompile Include="..\include\platform\user\code\platform-lib-calls.c">
<Filter>code\platform</Filter>
</ClCompile>
</ItemGroup>
</Project>