c++config (_GLIBCXX_SYNCHRONIZATION_HAPPENS_BEFORE, [...]): Add.
[official-gcc.git] / libstdc++-v3 / libsupc++ / exception_defines.h
blob951d96f32f38a8b100211d05965664fc0c35ec6d
1 // -fno-exceptions Support -*- C++ -*-
3 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009
4 // Free Software Foundation, Inc.
5 //
6 // This file is part of the GNU ISO C++ Library. This library is free
7 // software; you can redistribute it and/or modify it under the
8 // terms of the GNU General Public License as published by the
9 // Free Software Foundation; either version 3, or (at your option)
10 // any later version.
12 // This library is distributed in the hope that it will be useful,
13 // but WITHOUT ANY WARRANTY; without even the implied warranty of
14 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 // GNU General Public License for more details.
17 // Under Section 7 of GPL version 3, you are granted additional
18 // permissions described in the GCC Runtime Library Exception, version
19 // 3.1, as published by the Free Software Foundation.
21 // You should have received a copy of the GNU General Public License and
22 // a copy of the GCC Runtime Library Exception along with this program;
23 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
24 // <http://www.gnu.org/licenses/>.
27 // ISO C++ 14882: 19.1 Exception classes
30 /** @file exception_defines.h
31 * This is a Standard C++ Library header.
34 #ifndef _EXCEPTION_DEFINES_H
35 #define _EXCEPTION_DEFINES_H 1
37 #ifndef __EXCEPTIONS
38 // Iff -fno-exceptions, transform error handling code to work without it.
39 # define __try if (true)
40 # define __catch(X) if (false)
41 # define __throw_exception_again
42 #else
43 // Else proceed normally.
44 # define __try try
45 # define __catch(X) catch(X)
46 # define __throw_exception_again throw
47 #endif
49 #endif