eh_aux_runtime.cc revision 97403
10Sstevel@tonic-gate// -*- C++ -*- Common throw conditions.
20Sstevel@tonic-gate// Copyright (C) 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001
30Sstevel@tonic-gate// Free Software Foundation
40Sstevel@tonic-gate//
57387SRobert.Gordon@Sun.COM// This file is part of GNU CC.
67387SRobert.Gordon@Sun.COM//
70Sstevel@tonic-gate// GNU CC is free software; you can redistribute it and/or modify
80Sstevel@tonic-gate// it under the terms of the GNU General Public License as published by
90Sstevel@tonic-gate// the Free Software Foundation; either version 2, or (at your option)
100Sstevel@tonic-gate// any later version.
110Sstevel@tonic-gate//
120Sstevel@tonic-gate// GNU CC is distributed in the hope that it will be useful,
130Sstevel@tonic-gate// but WITHOUT ANY WARRANTY; without even the implied warranty of
140Sstevel@tonic-gate// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
150Sstevel@tonic-gate// GNU General Public License for more details.
160Sstevel@tonic-gate//
170Sstevel@tonic-gate// You should have received a copy of the GNU General Public License
180Sstevel@tonic-gate// along with GNU CC; see the file COPYING.  If not, write to
190Sstevel@tonic-gate// the Free Software Foundation, 59 Temple Place - Suite 330,
200Sstevel@tonic-gate// Boston, MA 02111-1307, USA.
210Sstevel@tonic-gate
227387SRobert.Gordon@Sun.COM// As a special exception, you may use this file as part of a free software
230Sstevel@tonic-gate// library without restriction.  Specifically, if other files instantiate
240Sstevel@tonic-gate// templates or use macros or inline functions from this file, or you compile
250Sstevel@tonic-gate// this file and link it with other files to produce an executable, this
260Sstevel@tonic-gate// file does not by itself cause the resulting executable to be covered by
270Sstevel@tonic-gate// the GNU General Public License.  This exception does not however
280Sstevel@tonic-gate// invalidate any other reasons why the executable file might be covered by
290Sstevel@tonic-gate// the GNU General Public License.
300Sstevel@tonic-gate
310Sstevel@tonic-gate#include "typeinfo"
320Sstevel@tonic-gate#include "exception"
330Sstevel@tonic-gate#include <cstdlib>
340Sstevel@tonic-gate#include "unwind-cxx.h"
350Sstevel@tonic-gate#include "exception_defines.h"
360Sstevel@tonic-gate
370Sstevel@tonic-gate
380Sstevel@tonic-gateextern "C" void
390Sstevel@tonic-gate__cxa_bad_cast ()
400Sstevel@tonic-gate{
410Sstevel@tonic-gate#ifdef __EXCEPTIONS
420Sstevel@tonic-gate  throw std::bad_cast();
430Sstevel@tonic-gate#else
440Sstevel@tonic-gate  std::abort();
450Sstevel@tonic-gate#endif
460Sstevel@tonic-gate}
470Sstevel@tonic-gate
480Sstevel@tonic-gateextern "C" void
490Sstevel@tonic-gate__cxa_bad_typeid ()
500Sstevel@tonic-gate{
510Sstevel@tonic-gate#ifdef __EXCEPTIONS
520Sstevel@tonic-gate  throw std::bad_typeid();
530Sstevel@tonic-gate#else
540Sstevel@tonic-gate  std::abort();
550Sstevel@tonic-gate#endif
560Sstevel@tonic-gate}
570Sstevel@tonic-gate
580Sstevel@tonic-gate