changeset 17802:f461e4a47680

* main.in.cc (main): Eliminate some #ifdefs.
author John W. Eaton <jwe@octave.org>
date Wed, 30 Oct 2013 00:33:39 -0400
parents 0b81d65d3c49
children f5ada8597078
files src/main.in.cc
diffstat 1 files changed, 5 insertions(+), 19 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.in.cc	Wed Oct 30 00:18:28 2013 -0400
+++ b/src/main.in.cc	Wed Oct 30 00:33:39 2013 -0400
@@ -399,17 +399,15 @@
 #if defined (HAVE_OCTAVE_GUI)
   bool start_gui = true;
   bool gui_libs = true;
+#else
+  bool start_gui = false;
+  bool gui_libs = false;
 #endif
 
   std::string octave_bindir = get_octave_bindir ();
 
-  std::string file = octave_bindir + dir_sep_char;
-
-#if defined (HAVE_OCTAVE_GUI)
-  file += "octave-gui";
-#else
-  file += "octave-cli";
-#endif
+  std::string file = octave_bindir + dir_sep_char
+    + (gui_libs ? "octave-gui" : "octave-cli");
 
   char **new_argv = new char * [argc + 1];
 
@@ -426,9 +424,7 @@
           // require less memory.  Don't pass the --no-gui-libs option
           // on as that option is not recognized by Octave.
 
-#if defined (HAVE_OCTAVE_GUI)
           gui_libs = false;
-#endif
           file = octave_bindir + dir_sep_char + "octave-cli";
         }
       else if (! strcmp (argv[i], "--no-gui"))
@@ -439,9 +435,7 @@
           // if the --no-gui option is given, we may be asked to do some
           // plotting or ui* calls.
 
-#if defined (HAVE_OCTAVE_GUI)
           start_gui = false;
-#endif
           new_argv[k++] = argv[i];
         }
       else
@@ -450,12 +444,6 @@
 
   new_argv[k] = 0;
 
-#if ! defined (HAVE_OCTAVE_GUI) || defined (__WIN32__) || defined (__CYGWIN__)
-
-  retval = octave_exec (file, new_argv);
-
-#else
-
   if (gui_libs && start_gui && have_controlling_terminal ())
     {
       install_signal_handlers ();
@@ -504,8 +492,6 @@
   else
     retval = octave_exec (file, new_argv);
 
-#endif
-
   return retval;
 }