Skip to content

Commit

Permalink
Merge pull request #449 from ElektroKill/fix/platform-check
Browse files Browse the repository at this point in the history
Use RuntimeInformation class to check environment.
  • Loading branch information
wtfsck authored Jan 8, 2022
2 parents 63a06e6 + 8f0b9ca commit 62883b9
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/IO/DataReaderFactoryFactory.cs
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

using System;
using System.IO;
using System.Runtime.InteropServices;

namespace dnlib.IO {
static class DataReaderFactoryFactory {
Expand All @@ -12,6 +13,10 @@ static DataReaderFactoryFactory() {
int p = (int)Environment.OSVersion.Platform;
if (p == 4 || p == 6 || p == 128)
isUnix = true;
#if NETSTANDARD
if (!RuntimeInformation.IsOSPlatform(OSPlatform.Windows))
isUnix = true;
#endif
}

public static DataReaderFactory Create(string fileName, bool mapAsImage) {
Expand Down

0 comments on commit 62883b9

Please sign in to comment.