changeset 21989:6bce4d23af6b

eliminate OCTAVE_USE_WINDOWS_API and OCTAVE_USE_OS_X_API from header files * sysdep.h, sysdep.cc (MINGW_SIGNAL_CLEANUP): Delete macro. (w32_set_quiet_shutdown, MINGW_signal_cleanup): Delete functions. (sysdep_cleanup): Do w32_set_quiet_shutdown here for Windows systems. * sighandlers.h, sighandlers.cc (my_friendly_exit): Call sysdep_cleanup instead of using MINGW_SIGNAL_CLEANUP macro. * oct-conf-post.in.h (OCTAVE_USE_WINDOWS_API, OCTAVE_USE_OS_X_API): Delete macro definitions.
author John W. Eaton <jwe@octave.org>
date Tue, 28 Jun 2016 16:42:15 -0400
parents 3ff59d4f9411
children efce657ceb86
files libinterp/corefcn/sighandlers.cc libinterp/corefcn/sysdep.cc libinterp/corefcn/sysdep.h oct-conf-post.in.h
diffstat 4 files changed, 10 insertions(+), 40 deletions(-) [+]
line wrap: on
line diff
--- a/libinterp/corefcn/sighandlers.cc	Tue Jun 28 15:08:27 2016 -0400
+++ b/libinterp/corefcn/sighandlers.cc	Tue Jun 28 16:42:15 2016 -0400
@@ -273,9 +273,10 @@
     {
       octave_set_signal_handler ("SIGABRT", SIG_DFL);
 
-      std::cerr << "panic: attempted clean up apparently failed -- aborting...\n";
+      std::cerr << "panic: attempted clean up failed -- aborting..."
+                << std::endl;
 
-      MINGW_SIGNAL_CLEANUP ();
+      sysdep_cleanup ();
 
       abort ();
     }
@@ -283,14 +284,15 @@
     {
       been_there_done_that = true;
 
-      std::cerr << "panic: " << sig_name << " -- stopping myself...\n";
+      std::cerr << "panic: " << sig_name << " -- stopping myself..."
+                << std::endl;
 
       if (save_vars)
         dump_octave_core ();
 
       if (sig_number < 0)
         {
-          MINGW_SIGNAL_CLEANUP ();
+          sysdep_cleanup ();
 
           exit (1);
         }
--- a/libinterp/corefcn/sysdep.cc	Tue Jun 28 15:08:27 2016 -0400
+++ b/libinterp/corefcn/sysdep.cc	Tue Jun 28 16:42:15 2016 -0400
@@ -160,22 +160,6 @@
     }
 }
 
-void
-w32_set_quiet_shutdown (void)
-{
-  // Let the user close the console window or shutdown without the
-  // pesky dialog.
-  //
-  // FIXME: should this be user configurable?
-  SetProcessShutdownParameters (0x280, SHUTDOWN_NORETRY);
-}
-
-void
-MINGW_signal_cleanup (void)
-{
-  w32_set_quiet_shutdown ();
-}
-
 static void
 w32_init (void)
 {
@@ -244,7 +228,6 @@
 }
 #endif
 
-
 // Return TRUE if FILE1 and FILE2 refer to the same (physical) file.
 
 bool
@@ -332,7 +315,10 @@
 void
 sysdep_cleanup (void)
 {
-  MINGW_SIGNAL_CLEANUP ();
+#if defined (OCTAVE_USE_WINDOWS_API)
+  // Let us fail immediately without displaying any dialog.
+  SetProcessShutdownParameters (0x280, SHUTDOWN_NORETRY);
+#endif
 }
 
 // Set terminal in raw mode.  From less-177.
--- a/libinterp/corefcn/sysdep.h	Tue Jun 28 15:08:27 2016 -0400
+++ b/libinterp/corefcn/sysdep.h	Tue Jun 28 16:42:15 2016 -0400
@@ -45,15 +45,6 @@
 
 extern OCTINTERP_API std::string get_P_tmpdir (void);
 
-extern void w32_set_quiet_shutdown (void);
-
-#if defined (OCTAVE_USE_WINDOWS_API)
-extern void MINGW_signal_cleanup (void);
-#  define MINGW_SIGNAL_CLEANUP() MINGW_signal_cleanup ()
-#else
-#  define MINGW_SIGNAL_CLEANUP() do { } while (0)
-#endif
-
 extern OCTINTERP_API bool same_file_internal (const std::string&,
                                               const std::string&);
 
--- a/oct-conf-post.in.h	Tue Jun 28 15:08:27 2016 -0400
+++ b/oct-conf-post.in.h	Tue Jun 28 16:42:15 2016 -0400
@@ -80,12 +80,7 @@
 #  pragma warning (disable: 4661)
 #endif
 
-/* Define to 1 if we expect to have <windows.h>, Sleep, etc. */
 #if defined (__WIN32__) && ! defined (__CYGWIN__)
-#  define OCTAVE_USE_WINDOWS_API 1
-#endif
-
-#if defined (OCTAVE_USE_WINDOWS_API)
 #  define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1
 #elif defined (__CYGWIN__)
 #  define OCTAVE_HAVE_WINDOWS_FILESYSTEM 1
@@ -94,10 +89,6 @@
 #  define OCTAVE_HAVE_POSIX_FILESYSTEM 1
 #endif
 
-#if defined (__APPLE__) && defined (__MACH__)
-#  define OCTAVE_USE_OS_X_API 1
-#endif
-
 /* sigsetjmp is a macro, not a function. */
 #if defined (sigsetjmp) && defined (HAVE_SIGLONGJMP)
 #  define OCTAVE_HAVE_SIG_JUMP 1