# HG changeset patch # User John W. Eaton # Date 1383107619 14400 # Node ID f461e4a4768031166fbf8ff678e099d75752e46a # Parent 0b81d65d3c49315f0e37a8e808d1ed36f28d01fc * main.in.cc (main): Eliminate some #ifdefs. diff -r 0b81d65d3c49 -r f461e4a47680 src/main.in.cc --- 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; }