xref: /freebsd/contrib/libcxxrt/noexception.cc (revision 56aaed38)
1*56aaed38SDimitry Andric /*
2*56aaed38SDimitry Andric  * Copyright 2021 Microsoft. All rights reserved.
3*56aaed38SDimitry Andric  *
4*56aaed38SDimitry Andric  * Redistribution and use in source and binary forms, with or without
5*56aaed38SDimitry Andric  * modification, are permitted provided that the following conditions are met:
6*56aaed38SDimitry Andric  *
7*56aaed38SDimitry Andric  * 1. Redistributions of source code must retain the above copyright notice,
8*56aaed38SDimitry Andric  *    this list of conditions and the following disclaimer.
9*56aaed38SDimitry Andric  *
10*56aaed38SDimitry Andric  * 2. Redistributions in binary form must reproduce the above copyright notice,
11*56aaed38SDimitry Andric  *    this list of conditions and the following disclaimer in the documentation
12*56aaed38SDimitry Andric  *    and/or other materials provided with the distribution.
13*56aaed38SDimitry Andric  *
14*56aaed38SDimitry Andric  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS ``AS
15*56aaed38SDimitry Andric  * IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
16*56aaed38SDimitry Andric  * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
17*56aaed38SDimitry Andric  * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
18*56aaed38SDimitry Andric  * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
19*56aaed38SDimitry Andric  * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
20*56aaed38SDimitry Andric  * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS;
21*56aaed38SDimitry Andric  * OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY,
22*56aaed38SDimitry Andric  * WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR
23*56aaed38SDimitry Andric  * OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
24*56aaed38SDimitry Andric  * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
25*56aaed38SDimitry Andric  */
26*56aaed38SDimitry Andric 
27*56aaed38SDimitry Andric namespace std
28*56aaed38SDimitry Andric {
29*56aaed38SDimitry Andric 	/**
30*56aaed38SDimitry Andric 	 * Returns whether there are any exceptions currently being thrown that
31*56aaed38SDimitry Andric 	 * have not been caught. Without exception support this is always false.
32*56aaed38SDimitry Andric 	 */
uncaught_exception()33*56aaed38SDimitry Andric 	bool uncaught_exception() throw()
34*56aaed38SDimitry Andric 	{
35*56aaed38SDimitry Andric 		return false;
36*56aaed38SDimitry Andric 	}
37*56aaed38SDimitry Andric 	/**
38*56aaed38SDimitry Andric 	 * Returns the number of exceptions currently being thrown that have not
39*56aaed38SDimitry Andric 	 * been caught. Without exception support this is always 0.
40*56aaed38SDimitry Andric 	 */
uncaught_exceptions()41*56aaed38SDimitry Andric 	int uncaught_exceptions() throw()
42*56aaed38SDimitry Andric 	{
43*56aaed38SDimitry Andric 		return 0;
44*56aaed38SDimitry Andric 	}
45*56aaed38SDimitry Andric }
46