@@ -48,6 +48,7 @@ type internal DummyForm() =
4848 /// error during finalization of the half-initialized object...
4949 override x.Finalize () = ()
5050
51+ #if USE_ WINFORMS_ EVENT_ LOOP
5152/// This is the event loop implementation for winforms
5253let WinFormsEventLoop ( lcid : int option ) =
5354 let mainForm = new DummyForm()
@@ -94,6 +95,7 @@ let WinFormsEventLoop(lcid : int option) =
9495
9596 member x.ScheduleRestart () = restart := true ; Application.Exit() }
9697
98+ #endif
9799
98100let StartServer ( fsiSession : FsiEvaluationSession ) ( fsiServerName ) =
99101 let server =
@@ -176,8 +178,11 @@ let MainMain argv =
176178 else
177179 None
178180
181+ #if USE_ FSharp_ Compiler_ Interactive_ Settings
179182 let fsiConfig0 = FsiEvaluationSession.GetDefaultConfiguration( fsi)
180-
183+ #else
184+ let fsiConfig0 = FsiEvaluationSession.GetDefaultConfiguration()
185+ #endif
181186 let rec fsiConfig =
182187 { // Update the configuration to include 'StartServer' and 'OptionalConsoleReadLine'
183188 new FsiEvaluationSessionHostConfig () with
@@ -220,12 +225,14 @@ let MainMain argv =
220225 with _ ->
221226 ()
222227
228+ #if USE_ WINFORMS_ EVENT_ LOOP
223229 try fsi.EventLoop <- WinFormsEventLoop( fsiSession.LCID)
224230 with e ->
225231 printfn " Your system doesn't seem to support WinForms correctly. You will"
226232 printfn " need to set fsi.EventLoop use GUI windows from F# Interactive."
227233 printfn " You can set different event loops for MonoMac, Gtk#, WinForms and other"
228234 printfn " UI toolkits. Drop the --gui argument if no event loop is required."
235+ #endif
229236
230237
231238 console.SetCompletionFunction( fun ( s1 , s2 ) -> fsiSession.GetCompletions ( match s1 with | Some s -> s + " ." + s2 | None -> s2))
0 commit comments