Fix code for loadlibrary on windows and fix code for certain platforms
This commit is contained in:
@ -4,12 +4,5 @@ include("${CMAKE_CURRENT_LIST_DIR}/TessesCrossLangTargets.cmake")
|
|||||||
|
|
||||||
check_required_components(TessesCrossLang)
|
check_required_components(TessesCrossLang)
|
||||||
find_package(TessesFramework REQUIRED)
|
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()
|
endif()
|
||||||
@ -132,7 +132,7 @@ void DumpFile(std::filesystem::path p)
|
|||||||
|
|
||||||
for(size_t i = 1; i < closures.size(); i++)
|
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: ";
|
std::cout << "Func: ";
|
||||||
auto res = funs[(uint32_t)i];
|
auto res = funs[(uint32_t)i];
|
||||||
|
|||||||
@ -66,7 +66,7 @@ int main(int argc, char** argv)
|
|||||||
|
|
||||||
Tesses::Framework::Streams::MemoryStream strm2(true);
|
Tesses::Framework::Streams::MemoryStream strm2(true);
|
||||||
|
|
||||||
if(source.starts_with("loadfile "))
|
if(source.find("loadfile ") == 0)
|
||||||
{
|
{
|
||||||
std::string filename = source.substr(9);
|
std::string filename = source.substr(9);
|
||||||
|
|
||||||
|
|||||||
@ -26,7 +26,7 @@ namespace Tesses::CrossLang
|
|||||||
T Resolve(std::string name)
|
T Resolve(std::string name)
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
return (T)GetProcAddress(handle,name.c_str());
|
return (T)GetProcAddress((HMODULE)handle,name.c_str());
|
||||||
#else
|
#else
|
||||||
return (T)dlsym(handle,name.c_str());
|
return (T)dlsym(handle,name.c_str());
|
||||||
|
|
||||||
@ -35,7 +35,7 @@ namespace Tesses::CrossLang
|
|||||||
~DL()
|
~DL()
|
||||||
{
|
{
|
||||||
#if defined(_WIN32)
|
#if defined(_WIN32)
|
||||||
FreeLibrary(handle);
|
FreeLibrary((HMODULE)handle);
|
||||||
#else
|
#else
|
||||||
dlclose(handle);
|
dlclose(handle);
|
||||||
#endif
|
#endif
|
||||||
|
|||||||
Reference in New Issue
Block a user