1232950Stheraven/* 2232950Stheraven * Copyright 2010-2011 PathScale, Inc. All rights reserved. 3232950Stheraven * 4232950Stheraven * Redistribution and use in source and binary forms, with or without 5232950Stheraven * modification, are permitted provided that the following conditions are met: 6232950Stheraven * 7232950Stheraven * 1. Redistributions of source code must retain the above copyright notice, 8232950Stheraven * this list of conditions and the following disclaimer. 9232950Stheraven * 10232950Stheraven * 2. Redistributions in binary form must reproduce the above copyright notice, 11232950Stheraven * this list of conditions and the following disclaimer in the documentation 12232950Stheraven * and/or other materials provided with the distribution. 13232950Stheraven * 14232950Stheraven * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS 15232950Stheraven * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, 16232950Stheraven * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR 17232950Stheraven * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR 18232950Stheraven * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 19232950Stheraven * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, 20232950Stheraven * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; 21232950Stheraven * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, 22232950Stheraven * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR 23232950Stheraven * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 24232950Stheraven * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25232950Stheraven */ 26232950Stheraven 27227825Stheraven/** 28227825Stheraven * stdexcept.h - provides a stub version of <stdexcept>, which defines enough 29227825Stheraven * of the exceptions for the runtime to use. 30227825Stheraven */ 31227825Stheraven 32227825Stheravennamespace std 33227825Stheraven{ 34227825Stheraven 35227825Stheraven class exception 36227825Stheraven { 37227825Stheraven public: 38227825Stheraven exception() throw(); 39227825Stheraven exception(const exception&) throw(); 40227825Stheraven exception& operator=(const exception&) throw(); 41227825Stheraven virtual ~exception(); 42227825Stheraven virtual const char* what() const throw(); 43227825Stheraven }; 44227825Stheraven 45227825Stheraven 46227825Stheraven /** 47227825Stheraven * Bad allocation exception. Thrown by ::operator new() if it fails. 48227825Stheraven */ 49227825Stheraven class bad_alloc: public exception 50227825Stheraven { 51227825Stheraven public: 52227825Stheraven bad_alloc() throw(); 53227825Stheraven bad_alloc(const bad_alloc&) throw(); 54227825Stheraven bad_alloc& operator=(const bad_alloc&) throw(); 55227825Stheraven ~bad_alloc(); 56227825Stheraven virtual const char* what() const throw(); 57227825Stheraven }; 58227825Stheraven 59227825Stheraven /** 60227825Stheraven * Bad cast exception. Thrown by the __cxa_bad_cast() helper function. 61227825Stheraven */ 62227825Stheraven class bad_cast: public exception { 63227825Stheraven public: 64227825Stheraven bad_cast() throw(); 65227825Stheraven bad_cast(const bad_cast&) throw(); 66227825Stheraven bad_cast& operator=(const bad_cast&) throw(); 67227825Stheraven virtual ~bad_cast(); 68227825Stheraven virtual const char* what() const throw(); 69227825Stheraven }; 70227825Stheraven 71227825Stheraven /** 72227825Stheraven * Bad typeidexception. Thrown by the __cxa_bad_typeid() helper function. 73227825Stheraven */ 74227825Stheraven class bad_typeid: public exception 75227825Stheraven { 76227825Stheraven public: 77227825Stheraven bad_typeid() throw(); 78227825Stheraven bad_typeid(const bad_typeid &__rhs) throw(); 79227825Stheraven virtual ~bad_typeid(); 80227825Stheraven bad_typeid& operator=(const bad_typeid &__rhs) throw(); 81227825Stheraven virtual const char* what() const throw(); 82227825Stheraven }; 83227825Stheraven 84227825Stheraven 85227825Stheraven 86227825Stheraven} // namespace std 87227825Stheraven 88