Fix code for loadlibrary on windows and fix code for certain platforms

This commit is contained in:
2025-01-26 09:22:10 -06:00
parent f2ce9d260c
commit 3f337239e4
4 changed files with 7 additions and 14 deletions

View File

@ -4,12 +4,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/TessesCrossLangTargets.cmake")
check_required_components(TessesCrossLang)
find_package(TessesFramework REQUIRED)
if(@CROSSLANG_ENABLE_SDL2@)
find_package(SDL2 REQUIRED)
find_package(SDL2_ttf REQUIRED)
if("${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoWii" OR "${CMAKE_SYSTEM_NAME}" STREQUAL "NintendoGameCube")
else()
find_package(SDL2_image REQUIRED)
endif()
endif()

View File

@ -132,7 +132,7 @@ void DumpFile(std::filesystem::path p)
for(size_t i = 1; i < closures.size(); i++)
{
if(funs.contains((uint32_t)i))
if(funs.count((uint32_t)i) > 0)
{
std::cout << "Func: ";
auto res = funs[(uint32_t)i];

View File

@ -66,7 +66,7 @@ int main(int argc, char** argv)
Tesses::Framework::Streams::MemoryStream strm2(true);
if(source.starts_with("loadfile "))
if(source.find("loadfile ") == 0)
{
std::string filename = source.substr(9);

View File

@ -26,7 +26,7 @@ namespace Tesses::CrossLang
T Resolve(std::string name)
{
#if defined(_WIN32)
return (T)GetProcAddress(handle,name.c_str());
return (T)GetProcAddress((HMODULE)handle,name.c_str());
#else
return (T)dlsym(handle,name.c_str());
@ -35,7 +35,7 @@ namespace Tesses::CrossLang
~DL()
{
#if defined(_WIN32)
FreeLibrary(handle);
FreeLibrary((HMODULE)handle);
#else
dlclose(handle);
#endif