Cleanup and minor fixes

This commit is contained in:
2022-11-27 14:45:55 +02:00
parent 0d68e90b59
commit 76ee695a59
5 changed files with 7 additions and 24 deletions

View File

@@ -50,14 +50,14 @@ int APIENTRY wWinMain(HINSTANCE hInstance, HINSTANCE hPrevInstance, LPTSTR lpCmd
#endif
Platform::PreInit(hInstance);
//__try
__try
{
return Engine::Main(lpCmdLine);
}
/*__except (SehExceptionHandler(GetExceptionInformation()))
__except (SehExceptionHandler(GetExceptionInformation()))
{
return -1;
}*/
}
}
#endif

View File

@@ -109,23 +109,6 @@ bool CoreCLR::InitHostfxr(const String& config_path, const String& library_path_
return true;
}
void* CoreCLR::GetFunctionPointerFromDelegate(const String& methodName)
{
void* fun;
if (cachedFunctions.TryGet(methodName, fun))
return fun;
String delegateTypeName = String::Format(TEXT("{0}+{1}Delegate, {2}"), TEXT("FlaxEngine.NativeInterop"), methodName, assemblyName);
int rc = get_function_pointer(typeName, FLAX_CORECLR_STRING(methodName).Get(), FLAX_CORECLR_STRING(delegateTypeName).Get(), nullptr, nullptr, &fun);
if (rc != 0)
LOG(Fatal, "Failed to get unmanaged function pointer for method {0}: 0x{1:x}", methodName.Get(), (unsigned int)rc);
cachedFunctions.Add(String(methodName), fun);
return fun;
}
void* CoreCLR::GetStaticMethodPointer(const String& methodName)
{
void* fun;

View File

@@ -21,7 +21,6 @@ public:
static bool LoadHostfxr(const String& library_path);
static bool InitHostfxr(const String& config_path, const String& library_path);
static void* GetFunctionPointerFromDelegate(const String& methodName);
static void* GetStaticMethodPointer(const String& methodName);
template<typename RetType, typename ...Args>

View File

@@ -110,6 +110,7 @@ public:
~CoreCLRAssembly()
{
_classes.ClearDelete();
assemblyHandles.Remove(_assemblyHandle);
}
void* GetHandle()

View File

@@ -176,9 +176,9 @@ namespace Flax.Build.Projects.VisualStudio
vcProjectFileContent.AppendLine(" <LibraryWPath />");
vcProjectFileContent.AppendLine(" <SourcePath />");
vcProjectFileContent.AppendLine(" <ExcludePath />");
vcProjectFileContent.AppendLine(string.Format(" <NMakeBuildCommandLine>dotnet {0} -build</NMakeBuildCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeReBuildCommandLine>dotnet {0} -rebuild</NMakeReBuildCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeCleanCommandLine>dotnet {0} -clean</NMakeCleanCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeBuildCommandLine>{0} -build</NMakeBuildCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeReBuildCommandLine>{0} -rebuild</NMakeReBuildCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeCleanCommandLine>{0} -clean</NMakeCleanCommandLine>", cmdLine));
vcProjectFileContent.AppendLine(string.Format(" <NMakeOutput>{0}</NMakeOutput>", outputTargetFilePath));
if (preprocessorDefinitions.Count != 0)