1
|
1 // sysdep.cc -*- C++ -*- |
|
2 /* |
|
3 |
|
4 Copyright (C) 1993 John W. Eaton |
|
5 |
|
6 This file is part of Octave. |
|
7 |
|
8 Octave is free software; you can redistribute it and/or modify it |
|
9 under the terms of the GNU General Public License as published by the |
|
10 Free Software Foundation; either version 2, or (at your option) any |
|
11 later version. |
|
12 |
|
13 Octave is distributed in the hope that it will be useful, but WITHOUT |
|
14 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
|
15 FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
|
16 for more details. |
|
17 |
|
18 You should have received a copy of the GNU General Public License |
|
19 along with Octave; see the file COPYING. If not, write to the Free |
|
20 Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. |
|
21 |
|
22 */ |
|
23 |
|
24 #ifdef __GNUG__ |
|
25 #pragma implementation |
|
26 #endif |
|
27 |
|
28 #include <stdlib.h> |
|
29 |
|
30 #include "error.h" |
|
31 |
|
32 #ifdef NeXT |
|
33 extern "C" |
|
34 { |
|
35 typedef void (*_cplus_fcn_int) (int); |
|
36 extern void (*malloc_error (_cplus_fcn_int)) (int); |
|
37 } |
|
38 |
|
39 static void |
|
40 malloc_handler (int code) |
|
41 { |
|
42 if (code == 5) |
|
43 message ("malloc_handler", |
|
44 "hopefully recoverable malloc error: freeing wild pointer"); |
|
45 else |
|
46 { |
|
47 panic ("probably irrecoverable malloc error: code %d", code); |
|
48 } |
|
49 } |
|
50 |
|
51 static void |
|
52 NeXT_init (void) |
|
53 { |
|
54 malloc_error (malloc_handler); |
|
55 } |
|
56 #endif |
|
57 |
|
58 void |
|
59 sysdep_init (void) |
|
60 { |
|
61 #ifdef NeXT |
|
62 NeXT_init (); |
|
63 #endif |
|
64 } |
|
65 |
|
66 /* |
|
67 ;;; Local Variables: *** |
|
68 ;;; mode: C++ *** |
|
69 ;;; page-delimiter: "^/\\*" *** |
|
70 ;;; End: *** |
|
71 */ |