File tree Expand file tree Collapse file tree 3 files changed +9
-6
lines changed
Expand file tree Collapse file tree 3 files changed +9
-6
lines changed Original file line number Diff line number Diff line change @@ -13,11 +13,17 @@ open Microsoft.FSharp.Compiler.AbstractIL
1313open Microsoft.FSharp .Compiler .AbstractIL .Internal
1414open Microsoft.FSharp .Compiler .AbstractIL .Internal .Library
1515open Microsoft.FSharp .Compiler .AbstractIL .Diagnostics
16+ open System
1617open System.Collections .Generic
1718open System.Collections
1819
1920let 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
Original file line number Diff line number Diff line change @@ -2275,6 +2275,7 @@ type ILPropertyRef =
22752275 member Name : string
22762276 interface System.IComparable
22772277
2278+ val runningOnWindows : bool
22782279val runningOnMono : bool
22792280
22802281type ILReferences =
Original file line number Diff line number Diff line change @@ -3971,19 +3971,15 @@ let ClosePdbReader pdb =
39713971#endif
39723972
39733973let OpenILModuleReader infile opts =
3974-
3975- #if FX_ NO_ NATIVE_ MEMORY_ MAPPED_ FILES
3976- #else
3977- try
3974+ if IL.runningOnWindows then
39783975 let mmap = MemoryMappedFile.Create infile
39793976 let modul , ilAssemblyRefs , pdb = genOpenBinaryReader infile mmap opts
39803977 { modul = modul;
39813978 ilAssemblyRefs= ilAssemblyRefs;
39823979 dispose = ( fun () ->
39833980 mmap.Close();
39843981 ClosePdbReader pdb) }
3985- with _ ->
3986- #endif
3982+ else
39873983 let mc = ByteFile.OpenIn infile
39883984 let modul , ilAssemblyRefs , pdb = genOpenBinaryReader infile mc opts
39893985 { modul = modul;
You can’t perform that action at this time.
0 commit comments