113547Sjulian/*
213547Sjulian * Copyright 2010-2011 PathScale, Inc. All rights reserved.
335025Sjb *
413547Sjulian * Redistribution and use in source and binary forms, with or without
513547Sjulian * modification, are permitted provided that the following conditions are met:
613547Sjulian *
713547Sjulian * 1. Redistributions of source code must retain the above copyright notice,
813547Sjulian *    this list of conditions and the following disclaimer.
913547Sjulian *
1013547Sjulian * 2. Redistributions in binary form must reproduce the above copyright notice,
1113547Sjulian *    this list of conditions and the following disclaimer in the documentation
1213547Sjulian *    and/or other materials provided with the distribution.
1313547Sjulian *
1413547Sjulian * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
1513547Sjulian * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
1613547Sjulian * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
1713547Sjulian * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
1813547Sjulian * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
1913547Sjulian * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
2013547Sjulian * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
2113547Sjulian * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
2213547Sjulian * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
2313547Sjulian * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
2413547Sjulian * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2513547Sjulian */
2613547Sjulian
2713547Sjulian/**
2813547Sjulian * stdexcept.h - provides a stub version of <stdexcept>, which defines enough
2913547Sjulian * of the exceptions for the runtime to use.
3013547Sjulian */
3113547Sjulian
3213547Sjuliannamespace std
3350473Speter{
3413547Sjulian
3513547Sjulian	class exception
3613547Sjulian	{
3713547Sjulian	public:
3813547Sjulian		exception() throw();
3913547Sjulian		exception(const exception&) throw();
4013547Sjulian		exception& operator=(const exception&) throw();
4113547Sjulian		virtual ~exception();
42146824Srodrigc		virtual const char* what() const throw();
43149692Sstefanf	};
44149692Sstefanf
45149692Sstefanf
4644965Sjb	/**
47149692Sstefanf	 * Bad allocation exception.  Thrown by ::operator new() if it fails.
4813547Sjulian	 */
4913547Sjulian	class bad_alloc: public exception
5017706Sjulian	{
5113547Sjulian	public:
5217706Sjulian		bad_alloc() throw();
5317706Sjulian		bad_alloc(const bad_alloc&) throw();
54149692Sstefanf		bad_alloc& operator=(const bad_alloc&) throw();
55149692Sstefanf		~bad_alloc();
56119736Sdavidxu		virtual const char* what() const throw();
5713547Sjulian	};
5813547Sjulian
5922315Sjulian	/**
6022315Sjulian	 * Bad cast exception.  Thrown by the __cxa_bad_cast() helper function.
6122315Sjulian	 */
6222315Sjulian	class bad_cast: public exception {
6322315Sjulian	public:
6422315Sjulian		bad_cast() throw();
6522315Sjulian		bad_cast(const bad_cast&) throw();
6622315Sjulian		bad_cast& operator=(const bad_cast&) throw();
6722315Sjulian		virtual ~bad_cast();
6822315Sjulian		virtual const char* what() const throw();
6922315Sjulian	};
7022315Sjulian
7122315Sjulian	/**
7238919Salex	 * Bad typeidexception.  Thrown by the __cxa_bad_typeid() helper function.
7338919Salex	 */
7438919Salex	class bad_typeid: public exception
7538919Salex	{
7638919Salex	public:
7738919Salex		bad_typeid() throw();
7853812Salfred		bad_typeid(const bad_typeid &__rhs) throw();
7953812Salfred		virtual ~bad_typeid();
8053812Salfred		bad_typeid& operator=(const bad_typeid &__rhs) throw();
8153812Salfred		virtual const char* what() const throw();
8253812Salfred	};
8353812Salfred
8453812Salfred	class bad_array_new_length: public bad_alloc
8553812Salfred	{
8653812Salfred	public:
8713547Sjulian		bad_array_new_length() throw();
8813547Sjulian		bad_array_new_length(const bad_array_new_length&) throw();
8913547Sjulian		bad_array_new_length& operator=(const bad_array_new_length&) throw();
9013547Sjulian		virtual ~bad_array_new_length();
9113547Sjulian		virtual const char *what() const throw();
9213547Sjulian	};
9313547Sjulian
9413547Sjulian
9517706Sjulian} // namespace std
9613547Sjulian
9713547Sjulian