Skip to content

Commit

Permalink
[unity]unity 2021下的编译错误
Browse files Browse the repository at this point in the history
  • Loading branch information
chexiongsheng committed Dec 18, 2024
1 parent 8ff3cc7 commit 101accb
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions unity/Assets/core/upm/Runtime/Src/IL2Cpp/Native/NativeAPI.cs
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,6 @@ public class NativeAPI
const string DLLNAME = "puerts";
#endif

[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern void InitialPuerts(IntPtr PesapiImpl);

[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetRegsterApi();

Expand All @@ -32,6 +29,11 @@ public class NativeAPI

[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr GetPapiEnvRef(IntPtr isolate);

#if PUERTS_IL2CPP_OPTIMIZATION && ENABLE_IL2CPP

[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern void InitialPuerts(IntPtr PesapiImpl);

[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern IntPtr CreateCSharpTypeInfo(string name, IntPtr type_id, IntPtr super_type_id, bool isValueType, bool isDelegate, string delegateSignature);
Expand Down Expand Up @@ -60,17 +62,12 @@ public class NativeAPI
[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern bool RegisterCSharpType(IntPtr classInfo);

//[DllImport(DLLNAME, CallingConvention = CallingConvention.Cdecl)]
//public static extern void SetObjectPool(IntPtr jsEnv, IntPtr objectPoolAddMethodInfo, IntPtr objectPoolAdd, IntPtr objectPoolRemoveMethodInfo, IntPtr objectPoolRemove, IntPtr objectPoolInstance);

[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern void AddPendingKillScriptObjects(IntPtr ffiApi, IntPtr jsEnv, IntPtr valueRef);

[DllImport("__Internal", CallingConvention = CallingConvention.Cdecl)]
public static extern void CleanupPendingKillScriptObjects(IntPtr jsEnv);

#if PUERTS_IL2CPP_OPTIMIZATION && ENABLE_IL2CPP

[MethodImpl(MethodImplOptions.InternalCall)]
public static IntPtr InitialPapiEnvRef(IntPtr api, IntPtr envRef, Object obj, MethodBase addMethodBase, MethodBase removeMethodBase)
{
Expand Down Expand Up @@ -171,7 +168,6 @@ public static object EvalInternal(IntPtr apis, IntPtr envHolder, byte[] code, st
{
throw new NotImplementedException();
}
#endif

#if UNITY_EDITOR_WIN || UNITY_STANDALONE_WIN || PUERTS_GENERAL || (UNITY_WSA && !UNITY_EDITOR)
[UnmanagedFunctionPointer(CallingConvention.Cdecl)]
Expand Down Expand Up @@ -221,6 +217,7 @@ public static void SetLogCallback(LogCallback log, LogCallback logWarning, LogCa
throw;
}
}
#endif
}

public delegate void pesapi_callback(IntPtr apis, IntPtr info);
Expand Down

0 comments on commit 101accb

Please sign in to comment.