changeset 17805:2a15970da7f0

allow main.cc to build again with --disable-gui * main.in.cc (install_signal_handlers, have_controlling_terminal): Always define.
author John W. Eaton <jwe@octave.org>
date Wed, 30 Oct 2013 12:43:15 -0400
parents f3e25230b1f3
children a9ba926bc06d
files src/main.in.cc
diffstat 1 files changed, 13 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/main.in.cc	Wed Oct 30 02:08:41 2013 -0400
+++ b/src/main.in.cc	Wed Oct 30 12:43:15 2013 -0400
@@ -40,7 +40,13 @@
 #include <string>
 
 // From gnulib, so OK for Windows too.
+#include <sys/types.h>
 #include <unistd.h>
+#include <fcntl.h>
+
+// This is a liboctave header, but it doesn't include any other Octave
+// headers or declare any functions that are defined in liboctave.
+#include "syswait.h"
 
 #if defined (__WIN32__) && ! defined (_POSIX_VERSION)
 
@@ -102,16 +108,9 @@
 
 #endif
 
-#if (defined (HAVE_OCTAVE_GUI) \
-     && ! defined (__WIN32__) && ! defined (__CYGWIN__))
+#if ! defined (__WIN32__) && ! defined (__CYGWIN__)
 
-#include <sys/types.h>
 #include <signal.h>
-#include <fcntl.h>
-
-// This is a liboctave header, but it doesn't include any other Octave
-// headers or declare any functions that are defined in liboctave.
-#include "syswait.h"
 
 typedef void sig_handler (int);
 
@@ -142,9 +141,12 @@
   return oact.sa_handler;
 }
 
+#endif
+
 static void
 install_signal_handlers (void)
 {
+#if ! defined (__WIN32__) && ! defined (__CYGWIN__)
 
 #ifdef SIGINT
   octave_set_signal_handler (SIGINT, gui_driver_sig_handler);
@@ -261,14 +263,16 @@
   octave_set_signal_handler (SIGXFSZ, gui_driver_sig_handler);
 #endif
 
+#endif
 }
 
+
 static bool
 have_controlling_terminal (void)
 {
   int retval = false;
 
-#if ! (defined (__WIN32__) || defined (__APPLE__)) || defined (__CYGWIN__)
+#if ! defined (__WIN32__) && ! defined (__CYGWIN__)
 
 #if defined (HAVE_CTERMID)
   const char *ctty = ctermid (0);
@@ -290,8 +294,6 @@
   return retval;
 }
 
-#endif
-
 #ifndef OCTAVE_BINDIR
 #define OCTAVE_BINDIR %OCTAVE_BINDIR%
 #endif