diff --git a/AssimpNet/MemoryHelper.cs b/AssimpNet/MemoryHelper.cs index 459270c..5044bd9 100755 --- a/AssimpNet/MemoryHelper.cs +++ b/AssimpNet/MemoryHelper.cs @@ -382,11 +382,7 @@ public static void MarshalStructure(IntPtr ptr, out T value) where T : struct return; } -#if NETSTANDARD1_3 value = Marshal.PtrToStructure(ptr); -#else - value = (T) Marshal.PtrToStructure(ptr, type); -#endif } /// @@ -407,11 +403,7 @@ public static T MarshalStructure(IntPtr ptr) where T : struct if (HasNativeCustomMarshaler(type, out marshaler)) return (T) marshaler.MarshalNativeToManaged(ptr); -#if NETSTANDARD1_3 return Marshal.PtrToStructure(ptr); -#else - return (T) Marshal.PtrToStructure(ptr, type); -#endif } /// @@ -433,11 +425,7 @@ public static void MarshalPointer(in T value, IntPtr ptr) where T : struct return; } -#if NETSTANDARD1_3 Marshal.StructureToPtr(value, ptr, true); -#else - Marshal.StructureToPtr((object)value, ptr, true); -#endif } /// @@ -454,11 +442,7 @@ public static unsafe int MarshalSizeOf() where T : struct if (HasNativeCustomMarshaler(type, out marshaler)) return marshaler.NativeDataSize; -#if NETSTANDARD1_3 return Marshal.SizeOf(); -#else - return Marshal.SizeOf(type); -#endif } /// @@ -836,11 +820,9 @@ public static int Count(IEnumerable source) if(otherColl != null) return otherColl.Count; -#if NETSTANDARD1_3 IReadOnlyCollection roColl = source as IReadOnlyCollection; if(roColl != null) return roColl.Count; -#endif int count = 0; using(IEnumerator enumerator = source.GetEnumerator()) diff --git a/AssimpNet/Unmanaged/PlatformHelper.cs b/AssimpNet/Unmanaged/PlatformHelper.cs index cdc493a..c550c59 100644 --- a/AssimpNet/Unmanaged/PlatformHelper.cs +++ b/AssimpNet/Unmanaged/PlatformHelper.cs @@ -26,48 +26,6 @@ namespace Assimp.Unmanaged { - /* -#if !NETSTANDARD1_3 - internal enum OSPlatform - { - Windows = 0, - Linux = 1, - OSX = 2 - } - - internal static class RuntimeInformation - { - private static OSPlatform s_platform; - - static RuntimeInformation() - { - switch (Environment.OSVersion.Platform) - { - case PlatformID.Unix: - if (Directory.Exists("/Applications") && Directory.Exists("/System") && Directory.Exists("/Users") && Directory.Exists("/Volumes")) - s_platform = OSPlatform.OSX; - else - s_platform = OSPlatform.Linux; - break; - case PlatformID.MacOSX: - s_platform = OSPlatform.OSX; - break; - default: - s_platform = OSPlatform.Windows; - break; - } - } - - public static bool IsOSPlatform(OSPlatform osPlat) - { - return s_platform == osPlat; - } - - // Non-net standard will be windows only - public static string OSDescription { get { return "Microsoft Windows"; } } - } -#endif - */ //Helper class for making it easier to access certain reflection methods on types between .Net framework and .Net standard (pre-netstandard 2.0) internal class PlatformHelper { diff --git a/AssimpNet/Unmanaged/UnmanagedStructures.cs b/AssimpNet/Unmanaged/UnmanagedStructures.cs index 576448c..c7c981c 100755 --- a/AssimpNet/Unmanaged/UnmanagedStructures.cs +++ b/AssimpNet/Unmanaged/UnmanagedStructures.cs @@ -399,25 +399,7 @@ public static string GetFormatHint(in AiTexture aiTex) { fixed (sbyte* charPtr = aiTex.FormatHint) { -#if !NETSTANDARD1_3 return new string(charPtr); -#else - //Determine how many actual characters there are... - int maxLen = s_nullFormat.Length; - int nonTerminatorCount = 0; - for(int i = 0; i < maxLen; i++) - { - if(aiTex.FormatHint[i] == '\0') - break; - - nonTerminatorCount++; - } - - if(nonTerminatorCount == 0) - return String.Empty; - - return Encoding.ASCII.GetString((byte*) charPtr, nonTerminatorCount); -#endif } } }