1f2c0917eSJonathan Schleifer/*
2f2c0917eSJonathan Schleifer * Copyright 2010-2011 PathScale, Inc. All rights reserved.
3f2c0917eSJonathan Schleifer *
4f2c0917eSJonathan Schleifer * Redistribution and use in source and binary forms, with or without
5f2c0917eSJonathan Schleifer * modification, are permitted provided that the following conditions are met:
6f2c0917eSJonathan Schleifer *
7f2c0917eSJonathan Schleifer * 1. Redistributions of source code must retain the above copyright notice,
8f2c0917eSJonathan Schleifer *    this list of conditions and the following disclaimer.
9f2c0917eSJonathan Schleifer *
10f2c0917eSJonathan Schleifer * 2. Redistributions in binary form must reproduce the above copyright notice,
11f2c0917eSJonathan Schleifer *    this list of conditions and the following disclaimer in the documentation
12f2c0917eSJonathan Schleifer *    and/or other materials provided with the distribution.
13f2c0917eSJonathan Schleifer *
14f2c0917eSJonathan Schleifer * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
15f2c0917eSJonathan Schleifer * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16f2c0917eSJonathan Schleifer * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17f2c0917eSJonathan Schleifer * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18f2c0917eSJonathan Schleifer * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19f2c0917eSJonathan Schleifer * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20f2c0917eSJonathan Schleifer * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21f2c0917eSJonathan Schleifer * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22f2c0917eSJonathan Schleifer * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23f2c0917eSJonathan Schleifer * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24f2c0917eSJonathan Schleifer * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25f2c0917eSJonathan Schleifer */
26f2c0917eSJonathan Schleifer
27f2c0917eSJonathan Schleifer/**
28f2c0917eSJonathan Schleifer * stdexcept.h - provides a stub version of <stdexcept>, which defines enough
29f2c0917eSJonathan Schleifer * of the exceptions for the runtime to use.
30f2c0917eSJonathan Schleifer */
31f2c0917eSJonathan Schleifer
32f2c0917eSJonathan Schleifernamespace std
33f2c0917eSJonathan Schleifer{
34f2c0917eSJonathan Schleifer
35f2c0917eSJonathan Schleifer	class exception
36f2c0917eSJonathan Schleifer	{
37f2c0917eSJonathan Schleifer	public:
38f2c0917eSJonathan Schleifer		exception() throw();
39f2c0917eSJonathan Schleifer		exception(const exception&) throw();
40f2c0917eSJonathan Schleifer		exception& operator=(const exception&) throw();
41f2c0917eSJonathan Schleifer		virtual ~exception();
42f2c0917eSJonathan Schleifer		virtual const char* what() const throw();
43f2c0917eSJonathan Schleifer	};
44f2c0917eSJonathan Schleifer
45f2c0917eSJonathan Schleifer
46f2c0917eSJonathan Schleifer	/**
47f2c0917eSJonathan Schleifer	 * Bad allocation exception.  Thrown by ::operator new() if it fails.
48f2c0917eSJonathan Schleifer	 */
49f2c0917eSJonathan Schleifer	class bad_alloc: public exception
50f2c0917eSJonathan Schleifer	{
51f2c0917eSJonathan Schleifer	public:
52f2c0917eSJonathan Schleifer		bad_alloc() throw();
53f2c0917eSJonathan Schleifer		bad_alloc(const bad_alloc&) throw();
54f2c0917eSJonathan Schleifer		bad_alloc& operator=(const bad_alloc&) throw();
55f2c0917eSJonathan Schleifer		~bad_alloc();
56f2c0917eSJonathan Schleifer		virtual const char* what() const throw();
57f2c0917eSJonathan Schleifer	};
58f2c0917eSJonathan Schleifer
59f2c0917eSJonathan Schleifer	/**
60f2c0917eSJonathan Schleifer	 * Bad cast exception.  Thrown by the __cxa_bad_cast() helper function.
61f2c0917eSJonathan Schleifer	 */
62f2c0917eSJonathan Schleifer	class bad_cast: public exception {
63f2c0917eSJonathan Schleifer	public:
64f2c0917eSJonathan Schleifer		bad_cast() throw();
65f2c0917eSJonathan Schleifer		bad_cast(const bad_cast&) throw();
66f2c0917eSJonathan Schleifer		bad_cast& operator=(const bad_cast&) throw();
67f2c0917eSJonathan Schleifer		virtual ~bad_cast();
68f2c0917eSJonathan Schleifer		virtual const char* what() const throw();
69f2c0917eSJonathan Schleifer	};
70f2c0917eSJonathan Schleifer
71f2c0917eSJonathan Schleifer	/**
72f2c0917eSJonathan Schleifer	 * Bad typeidexception.  Thrown by the __cxa_bad_typeid() helper function.
73f2c0917eSJonathan Schleifer	 */
74f2c0917eSJonathan Schleifer	class bad_typeid: public exception
75f2c0917eSJonathan Schleifer	{
76f2c0917eSJonathan Schleifer	public:
77f2c0917eSJonathan Schleifer		bad_typeid() throw();
78f2c0917eSJonathan Schleifer		bad_typeid(const bad_typeid &__rhs) throw();
79f2c0917eSJonathan Schleifer		virtual ~bad_typeid();
80f2c0917eSJonathan Schleifer		bad_typeid& operator=(const bad_typeid &__rhs) throw();
81f2c0917eSJonathan Schleifer		virtual const char* what() const throw();
82f2c0917eSJonathan Schleifer	};
83f2c0917eSJonathan Schleifer
84f2c0917eSJonathan Schleifer	class bad_array_new_length: public bad_alloc
85f2c0917eSJonathan Schleifer	{
86f2c0917eSJonathan Schleifer	public:
87f2c0917eSJonathan Schleifer		bad_array_new_length() throw();
88f2c0917eSJonathan Schleifer		bad_array_new_length(const bad_array_new_length&) throw();
89f2c0917eSJonathan Schleifer		bad_array_new_length& operator=(const bad_array_new_length&) throw();
90f2c0917eSJonathan Schleifer		virtual ~bad_array_new_length();
91f2c0917eSJonathan Schleifer		virtual const char *what() const throw();
92f2c0917eSJonathan Schleifer	};
93f2c0917eSJonathan Schleifer
94f2c0917eSJonathan Schleifer
95f2c0917eSJonathan Schleifer} // namespace std
96f2c0917eSJonathan Schleifer
97