Skip to content

Commit ffe2b44

Browse files
committed
Changed conditional from mono check to Windows
1 parent 35d2e52 commit ffe2b44

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

src/absil/il.fs

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,17 @@ open Microsoft.FSharp.Compiler.AbstractIL
1313
open Microsoft.FSharp.Compiler.AbstractIL.Internal
1414
open Microsoft.FSharp.Compiler.AbstractIL.Internal.Library
1515
open Microsoft.FSharp.Compiler.AbstractIL.Diagnostics
16+
open System
1617
open System.Collections.Generic
1718
open System.Collections
1819

1920
let logging = false
2021

22+
let runningOnWindows =
23+
match System.Environment.OSVersion.Platform with
24+
| PlatformID.Win32NT | PlatformID.Win32S | PlatformID.Win32Windows | PlatformID.WinCE -> true
25+
| _ -> false
26+
2127
// Officially supported way to detect if we are running on Mono.
2228
// See http://www.mono-project.com/FAQ:_Technical
2329
// "How can I detect if am running in Mono?" section

src/absil/il.fsi

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2275,6 +2275,7 @@ type ILPropertyRef =
22752275
member Name: string
22762276
interface System.IComparable
22772277

2278+
val runningOnWindows: bool
22782279
val runningOnMono: bool
22792280

22802281
type ILReferences =

src/absil/ilread.fs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3971,7 +3971,7 @@ let ClosePdbReader pdb =
39713971
#endif
39723972

39733973
let OpenILModuleReader infile opts =
3974-
if not IL.runningOnMono then
3974+
if IL.runningOnWindows then
39753975
let mmap = MemoryMappedFile.Create infile
39763976
let modul,ilAssemblyRefs,pdb = genOpenBinaryReader infile mmap opts
39773977
{ modul = modul;

0 commit comments

Comments
 (0)