1187767Sluigi// -*- C++ -*- 2187767Sluigi// Copyright (C) 2000, 2001 Free Software Foundation 3187767Sluigi// 4187767Sluigi// This file is part of GCC. 5187767Sluigi// 6187767Sluigi// GCC is free software; you can redistribute it and/or modify 7187767Sluigi// it under the terms of the GNU General Public License as published by 8187767Sluigi// the Free Software Foundation; either version 2, or (at your option) 9187767Sluigi// any later version. 10187767Sluigi// 11187767Sluigi// GCC is distributed in the hope that it will be useful, 12187767Sluigi// but WITHOUT ANY WARRANTY; without even the implied warranty of 13187767Sluigi// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 14187767Sluigi// GNU General Public License for more details. 15187767Sluigi// 16187767Sluigi// You should have received a copy of the GNU General Public License 17187767Sluigi// along with GCC; see the file COPYING. If not, write to 18187767Sluigi// the Free Software Foundation, 51 Franklin Street, Fifth Floor, 19187767Sluigi// Boston, MA 02110-1301, USA. 20187767Sluigi// 21187767Sluigi// As a special exception, you may use this file as part of a free software 22187767Sluigi// library without restriction. Specifically, if other files instantiate 23187767Sluigi// templates or use macros or inline functions from this file, or you compile 24187767Sluigi// this file and link it with other files to produce an executable, this 25187767Sluigi// file does not by itself cause the resulting executable to be covered by 26187767Sluigi// the GNU General Public License. This exception does not however 27187767Sluigi// invalidate any other reasons why the executable file might be covered by 28187767Sluigi// the GNU General Public License. 29187767Sluigi 30187767Sluigi#include <bits/c++config.h> 31187767Sluigi#include <cxxabi.h> 32187767Sluigi#include "unwind-cxx.h" 33187767Sluigi 34187767Sluigi#if _GLIBCXX_HOSTED 35187767Sluigi#ifdef _GLIBCXX_HAVE_UNISTD_H 36187767Sluigi# include <unistd.h> 37187767Sluigi# define writestr(str) write(2, str, sizeof(str) - 1) 38204591Sluigi# ifdef __GNU_LIBRARY__ 39187767Sluigi /* Avoid forcing the library's meaning of `write' on the user program 40187767Sluigi by using the "internal" name (for use within the library). */ 41187767Sluigi/*# define write(fd, buf, n) __write((fd), (buf), (n))*/ 42187767Sluigi# endif 43187767Sluigi#else 44187767Sluigi# include <cstdio> 45187767Sluigi# define writestr(str) std::fputs(str, stderr) 46187767Sluigi#endif 47187767Sluigi#else 48187767Sluigi# define writestr(str) /* Empty */ 49346205Sae#endif 50346205Sae 51187767Sluigiextern "C" void 52187767Sluigi__cxxabiv1::__cxa_pure_virtual (void) 53187767Sluigi{ 54187767Sluigi writestr ("pure virtual method called\n"); 55187767Sluigi std::terminate (); 56187767Sluigi} 57187767Sluigi