diff --git a/.gitignore b/.gitignore
index 2584030..cefb631 100644
--- a/.gitignore
+++ b/.gitignore
@@ -12,3 +12,7 @@ obj/
*.ll
log
+
+# Ignore user specific options #
+
+.user
diff --git a/LX-Build/LX-API.cs b/LX-Build/LX-API.cs
index 5fc981d..4b94363 100644
--- a/LX-Build/LX-API.cs
+++ b/LX-Build/LX-API.cs
@@ -3,15 +3,17 @@ using System.Runtime.InteropServices;
namespace LX_Build
{
- internal class LX_API
+ internal partial class LX_API
{
// Imports SetDllDirectory to change where Dlls are imported from //
- [DllImport("kernel32.dll", SetLastError = true)]
- private static extern bool SetDllDirectory(string lpPathName);
+ [LibraryImport("kernel32.dll", EntryPoint = "SetDllDirectoryW", SetLastError = true, StringMarshalling = StringMarshalling.Utf16)]
+ [return: MarshalAs(UnmanagedType.Bool)]
+ private static partial bool SetDllDirectory(string lpPathName);
// Imports the Frontend of the compiler //
- [DllImport("Generator.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
- public static extern int GenIR(string arg1, string arg2, string? arg3);
+ [LibraryImport("Generator.dll", StringMarshalling = StringMarshalling.Custom, StringMarshallingCustomType = typeof(System.Runtime.InteropServices.Marshalling.AnsiStringMarshaller))]
+ [UnmanagedCallConv(CallConvs = new Type[] { typeof(System.Runtime.CompilerServices.CallConvCdecl) })]
+ public static partial int GenIR(string arg1, string arg2, string? arg3);
// Sets the directory to import the DLLs from //
public static void Init()
diff --git a/LX-Build/LX-Build.csproj b/LX-Build/LX-Build.csproj
index a51eeb8..66ce972 100644
--- a/LX-Build/LX-Build.csproj
+++ b/LX-Build/LX-Build.csproj
@@ -7,6 +7,7 @@
enable
enable
+ true