summaryrefslogtreecommitdiff
path: root/src/Fl_abort.cxx
diff options
context:
space:
mode:
authorManolo Gouy <Manolo>2016-03-28 15:22:20 +0000
committerManolo Gouy <Manolo>2016-03-28 15:22:20 +0000
commit28d1a2d6848d5abe555fd0ddae8b57cec6f900ca (patch)
treebb17efad1d942a3fee09b0ef9e858677060e2230 /src/Fl_abort.cxx
parent244a1a5bc439c0a3427e78f1dac9623b85f161bb (diff)
Rewrite Fl_abort.cxx under the driver model.
git-svn-id: file:///fltk/svn/fltk/branches/branch-1.3-porting@11452 ea41ed52-d2ee-0310-a9c1-e6b18d33e121
Diffstat (limited to 'src/Fl_abort.cxx')
-rw-r--r--src/Fl_abort.cxx76
1 files changed, 4 insertions, 72 deletions
diff --git a/src/Fl_abort.cxx b/src/Fl_abort.cxx
index a54004155..f0125e905 100644
--- a/src/Fl_abort.cxx
+++ b/src/Fl_abort.cxx
@@ -16,83 +16,15 @@
// http://www.fltk.org/str.php
//
-// This method is in its own source file so that stdlib and stdio
-// do not need to be included in Fl.cxx:
// You can also override this by redefining all of these.
#include <FL/Fl.H>
-#include <stdio.h>
-#include <stdlib.h>
+#include <FL/Fl_System_Driver.H>
#include <stdarg.h>
-#include "flstring.h"
-#if defined(WIN32) || defined(__APPLE__) // PORTME: Fl_Screen_Driver - native message box
-#elif defined(FL_PORTING)
-# pragma message "FL_PORTING: use native message box below if one is available"
-#else
-#endif
-
-#ifdef WIN32
-# include <windows.h>
-
-static void warning(const char *, ...) {
- // Show nothing for warnings under WIN32...
-}
-
-static void error(const char *format, ...) {
- va_list args;
- char buf[1024];
- va_start(args, format);
- vsnprintf(buf, 1024, format, args);
- va_end(args);
- MessageBox(0,buf,"Error",MB_ICONEXCLAMATION|MB_SYSTEMMODAL);
-}
-
-static void fatal(const char *format, ...) {
- va_list args;
- char buf[1024];
- va_start(args, format);
- vsnprintf(buf, 1024, format, args);
- va_end(args);
- MessageBox(0,buf,"Error",MB_ICONSTOP|MB_SYSTEMMODAL);
- ::exit(1);
-}
-
-#else
-
-static void warning(const char *format, ...) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- fputc('\n', stderr);
- fflush(stderr);
-}
-
-static void error(const char *format, ...) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- fputc('\n', stderr);
- fflush(stderr);
-}
-
-static void fatal(const char *format, ...) {
- va_list args;
- va_start(args, format);
- vfprintf(stderr, format, args);
- va_end(args);
- fputc('\n', stderr);
- fflush(stderr);
- ::exit(1);
-}
-
-#endif
-
-void (*Fl::warning)(const char* format, ...) = ::warning;
-void (*Fl::error)(const char* format, ...) = ::error;
-void (*Fl::fatal)(const char* format, ...) = ::fatal;
+void (*Fl::warning)(const char* format, ...) = Fl_System_Driver::warning;
+void (*Fl::error)(const char* format, ...) = Fl_System_Driver::error;
+void (*Fl::fatal)(const char* format, ...) = Fl_System_Driver::fatal;
//
// End of "$Id$".