Browse Source

Add support for iOS

nxrighthere 7 years ago
parent
commit
a5e3562a63
1 changed files with 6 additions and 2 deletions
  1. 6 2
      Source/Managed/ENet.cs

+ 6 - 2
Source/Managed/ENet.cs

@@ -714,7 +714,11 @@ namespace ENet {
 
 
 	[SuppressUnmanagedCodeSecurity]
 	[SuppressUnmanagedCodeSecurity]
 	internal static class Native {
 	internal static class Native {
-		private const string nativeLibrary = "enet";
+		#if __IOS__ || UNITY_IOS
+			private const string nativeLibrary = "__Internal";
+		#else
+			private const string nativeLibrary = "enet";
+		#endif
 
 
 		[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
 		[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
 		internal static extern int enet_initialize();
 		internal static extern int enet_initialize();
@@ -848,4 +852,4 @@ namespace ENet {
 		[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
 		[DllImport(nativeLibrary, CallingConvention = CallingConvention.Cdecl)]
 		internal static extern void enet_peer_reset(IntPtr peer);
 		internal static extern void enet_peer_reset(IntPtr peer);
 	}
 	}
-}
+}