libstdc++
exception_defines.h
Go to the documentation of this file.
00001 // -fno-exceptions Support -*- C++ -*-
00002 
00003 // Copyright (C) 2001, 2002, 2003, 2004, 2005, 2006, 2006, 2007, 2008, 2009,
00004 // 2011
00005 // Free Software Foundation, Inc.
00006 //
00007 // This file is part of the GNU ISO C++ Library.  This library is free
00008 // software; you can redistribute it and/or modify it under the
00009 // terms of the GNU General Public License as published by the
00010 // Free Software Foundation; either version 3, or (at your option)
00011 // any later version.
00012 
00013 // This library is distributed in the hope that it will be useful,
00014 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00015 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016 // GNU General Public License for more details.
00017 
00018 // Under Section 7 of GPL version 3, you are granted additional
00019 // permissions described in the GCC Runtime Library Exception, version
00020 // 3.1, as published by the Free Software Foundation.
00021 
00022 // You should have received a copy of the GNU General Public License and
00023 // a copy of the GCC Runtime Library Exception along with this program;
00024 // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
00025 // <http://www.gnu.org/licenses/>.
00026 
00027 /** @file bits/exception_defines.h
00028  *  This is an internal header file, included by other library headers.
00029  *  Do not attempt to use it directly. @headername{exception}
00030  */
00031 
00032 #ifndef _EXCEPTION_DEFINES_H
00033 #define _EXCEPTION_DEFINES_H 1
00034 
00035 #ifndef __EXCEPTIONS
00036 // Iff -fno-exceptions, transform error handling code to work without it.
00037 # define __try      if (true)
00038 # define __catch(X) if (false)
00039 # define __throw_exception_again
00040 #else
00041 // Else proceed normally.
00042 # define __try      try
00043 # define __catch(X) catch(X)
00044 # define __throw_exception_again throw
00045 #endif
00046 
00047 #endif