2 * CDE - Common Desktop Environment
4 * Copyright (c) 1993-2012, The Open Group. All rights reserved.
6 * These libraries and programs are free software; you can
7 * redistribute them and/or modify them under the terms of the GNU
8 * Lesser General Public License as published by the Free Software
9 * Foundation; either version 2 of the License, or (at your option)
12 * These libraries and programs are distributed in the hope that
13 * they will be useful, but WITHOUT ANY WARRANTY; without even the
14 * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
15 * PURPOSE. See the GNU Lesser General Public License for more
18 * You should have received a copy of the GNU Lesser General Public
19 * License along with these librararies and programs; if not, write
20 * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
21 * Floor, Boston, MA 02110-1301 USA
23 // $XConsortium: init.cc /main/3 1996/06/11 16:51:58 cde-hal $
25 #ifndef NATIVE_EXCEPTIONS
26 #include "Exceptions.hh"
28 //#define G_TEMP_SPACE_SIZE 1024
30 void initialize_exception()
33 Exceptions::f_msg_internal_error = "Internal exceptions error:";
34 Exceptions::f_msg_application_error = "Application exceptions error:";
35 Exceptions::f_msg_throw_message = "Application threw exception:";
37 Exceptions::f_msg_not_initialized =
38 "Exceptions library not initialized with INIT_EXCEPTIONS().";
40 Exceptions::f_msg_initialized_twice =
41 "Attept to call INIT_EXCEPTIONS() more than once.";
43 Exceptions::f_msg_not_caught =
44 "Exception not caught.";
46 Exceptions::f_msg_no_current_exception =
47 "There is no current exception (for catch or rethrow).";
49 Exceptions::f_msg_throw_from_terminate =
50 "Exceptions may not be thrown from terminate.";
52 Exceptions::f_msg_throw_from_error_handler =
53 "Exceptions may not be thrown from error handler.";
55 Exceptions::f_msg_throw_from_destructor =
56 "Exited destructor with throw while handling an exception.";
58 Exceptions::f_msg_throw_ptr_to_stack =
59 "Threw a pointer to an automatic (stack-based) exceptions object.";
61 Exceptions::f_msg_out_of_exception_memory =
62 "Not enough memory to allocate an exception object.";
64 Exceptions::f_msg_out_of_obj_stack_memory =
65 "Not enough memory to allocate object stack.";
67 Exceptions::f_msg_memory_already_freed =
68 "Tried to alloc or realloc pool memory that was previously freed.";
70 Unwind_Stack::g_stack = new Unwind_Record[UNWIND_STACK_SIZE];
71 Exception::g_temp_space = new char[G_TEMP_SPACE_SIZE];
72 Exception::g_next_avail = Exception::g_temp_space;
77 delete Unwind_Stack::g_stack;