xref: /minix3/external/bsd/libc++/dist/libcxxrt/src/terminate.cc (revision 4684ddb6aab0b36791c8099bc705d6140b3d05d0)
1*4684ddb6SLionel Sambuc /*
2*4684ddb6SLionel Sambuc  * Copyright 2010-2011 PathScale, Inc. All rights reserved.
3*4684ddb6SLionel Sambuc  *
4*4684ddb6SLionel Sambuc  * Redistribution and use in source and binary forms, with or without
5*4684ddb6SLionel Sambuc  * modification, are permitted provided that the following conditions are met:
6*4684ddb6SLionel Sambuc  *
7*4684ddb6SLionel Sambuc  * 1. Redistributions of source code must retain the above copyright notice,
8*4684ddb6SLionel Sambuc  *    this list of conditions and the following disclaimer.
9*4684ddb6SLionel Sambuc  *
10*4684ddb6SLionel Sambuc  * 2. Redistributions in binary form must reproduce the above copyright notice,
11*4684ddb6SLionel Sambuc  *    this list of conditions and the following disclaimer in the documentation
12*4684ddb6SLionel Sambuc  *    and/or other materials provided with the distribution.
13*4684ddb6SLionel Sambuc  *
14*4684ddb6SLionel Sambuc  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
15*4684ddb6SLionel Sambuc  * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16*4684ddb6SLionel Sambuc  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17*4684ddb6SLionel Sambuc  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18*4684ddb6SLionel Sambuc  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19*4684ddb6SLionel Sambuc  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20*4684ddb6SLionel Sambuc  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21*4684ddb6SLionel Sambuc  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22*4684ddb6SLionel Sambuc  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23*4684ddb6SLionel Sambuc  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24*4684ddb6SLionel Sambuc  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*4684ddb6SLionel Sambuc  */
26*4684ddb6SLionel Sambuc 
27*4684ddb6SLionel Sambuc #include <stdlib.h>
28*4684ddb6SLionel Sambuc 
29*4684ddb6SLionel Sambuc namespace std
30*4684ddb6SLionel Sambuc {
31*4684ddb6SLionel Sambuc 	/**
32*4684ddb6SLionel Sambuc 	 * Stub implementation of std::terminate.  Used when the STL implementation
33*4684ddb6SLionel Sambuc 	 * doesn't provide one.
34*4684ddb6SLionel Sambuc 	 */
35*4684ddb6SLionel Sambuc 	__attribute__((weak))
terminate()36*4684ddb6SLionel Sambuc 	void terminate()
37*4684ddb6SLionel Sambuc 	{
38*4684ddb6SLionel Sambuc 		abort();
39*4684ddb6SLionel Sambuc 	}
40*4684ddb6SLionel Sambuc }
41