mirror of https://github.com/Jackett/Jackett
Use platform detection that works on mono 4.6+ (#2055)
This commit is contained in:
parent
5c35ada012
commit
36bd2c032f
|
@ -1,7 +1,7 @@
|
|||
<Project Sdk="Microsoft.NET.Sdk">
|
||||
|
||||
<PropertyGroup>
|
||||
<TargetFrameworks>net452;netstandard1.5</TargetFrameworks>
|
||||
<TargetFrameworks>net452;netstandard2.0</TargetFrameworks>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
|
@ -9,13 +9,4 @@
|
|||
<PackageId>CurlSharp</PackageId>
|
||||
<GeneratePackageOnBuild>false</GeneratePackageOnBuild>
|
||||
</PropertyGroup>
|
||||
|
||||
|
||||
<ItemGroup>
|
||||
<PackageReference Include="System.Runtime.InteropServices.RuntimeInformation" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
|
||||
<ItemGroup Condition="'$(TargetFramework)' == 'netstandard1.5'">
|
||||
<PackageReference Include="System.Collections.NonGeneric" Version="4.3.0" />
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -46,16 +46,16 @@ namespace CurlSharp
|
|||
|
||||
static NativeMethods()
|
||||
{
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
switch (RuntimeInformation.OSArchitecture)
|
||||
if (Environment.Is64BitOperatingSystem)
|
||||
{
|
||||
case Architecture.X64:
|
||||
SetDllDirectory(Path.Combine(AssemblyDirectory, LIB_DIR_WIN64));
|
||||
break;
|
||||
case Architecture.X86:
|
||||
}
|
||||
else
|
||||
{
|
||||
SetDllDirectory(Path.Combine(AssemblyDirectory, LIB_DIR_WIN32));
|
||||
break;
|
||||
}
|
||||
}
|
||||
#if USE_LIBCURLSHIM
|
||||
|
@ -400,7 +400,7 @@ namespace CurlSharp
|
|||
{
|
||||
int result;
|
||||
|
||||
if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
|
||||
if (Environment.OSVersion.Platform == PlatformID.Win32NT)
|
||||
{
|
||||
result = select_win(
|
||||
nfds, // number of sockets, (ignored in winsock)
|
||||
|
|
Loading…
Reference in New Issue