Chameleon

Chameleon Svn Source Tree

Root/branches/meklort/i386/modules/uClibc++/func_exception.cpp

Source at commit 655 created 13 years 4 months ago.
By meklort, Modules update. removed hardcoding for dyld_stub_bunder in modules.c Added a subset of klibc for a more complete c library implimentation. Added a subset of uclibc++ for an initial c++ implimentation. Note: cout / cin / file io has been disabled. Also note that exceptions and rtti is disabled. Modified the helow world code foa small c++ test.
1/*Copyright (C) 2004 Garrett A. Kajmowicz
2
3This file is part of the uClibc++ Library.
4
5This library is free software; you can redistribute it and/or
6modify it under the terms of the GNU Lesser General Public
7License as published by the Free Software Foundation; either
8version 2.1 of the License, or (at your option) any later version.
9
10This library is distributed in the hope that it will be useful,
11but WITHOUT ANY WARRANTY; without even the implied warranty of
12MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13Lesser General Public License for more details.
14
15You should have received a copy of the GNU Lesser General Public
16License along with this library; if not, write to the Free Software
17Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
18*/
19
20#include <exception>
21#include <func_exception>
22#include <stdexcept>
23#include <cstdlib>
24
25namespace std{
26
27#ifdef __UCLIBCXX_EXCEPTION_SUPPORT__
28
29_UCXXEXPORT void __throw_bad_alloc(){
30throw bad_alloc();
31}
32
33_UCXXEXPORT void __throw_out_of_range( const char * message){
34if(message == 0){
35throw out_of_range();
36}
37throw out_of_range(message);
38}
39
40_UCXXEXPORT void __throw_overflow_error( const char * message){
41if(message == 0){
42throw overflow_error();
43}
44throw overflow_error(message);
45}
46
47_UCXXEXPORT void __throw_length_error(const char * message){
48if(message == 0){
49throw length_error();
50}
51throw length_error(message);
52}
53
54_UCXXEXPORT void __throw_invalid_argument(const char * message){
55if(message == 0){
56throw invalid_argument();
57}
58throw invalid_argument(message);
59}
60
61#else
62
63_UCXXEXPORT void __throw_bad_alloc(){
64abort();
65}
66
67_UCXXEXPORT void __throw_out_of_range( const char * ){
68abort();
69}
70
71_UCXXEXPORT void __throw_overflow_error( const char * ){
72abort();
73}
74
75_UCXXEXPORT void __throw_length_error(const char * ){
76abort();
77}
78
79_UCXXEXPORT void __throw_invalid_argument(const char *){
80abort();
81}
82
83#endif
84
85
86
87}
88

Archive Download this file

Revision: 655