xref: /netbsd-src/external/gpl3/gcc.old/dist/libstdc++-v3/libsupc++/exception_defines.h (revision 8feb0f0b7eaff0608f8350bbfa3098827b4bb91b)
11debfc3dSmrg // -fno-exceptions Support -*- C++ -*-
21debfc3dSmrg 
3*8feb0f0bSmrg // Copyright (C) 2001-2020 Free Software Foundation, Inc.
41debfc3dSmrg //
51debfc3dSmrg // This file is part of the GNU ISO C++ Library.  This library is free
61debfc3dSmrg // software; you can redistribute it and/or modify it under the
71debfc3dSmrg // terms of the GNU General Public License as published by the
81debfc3dSmrg // Free Software Foundation; either version 3, or (at your option)
91debfc3dSmrg // any later version.
101debfc3dSmrg 
111debfc3dSmrg // This library is distributed in the hope that it will be useful,
121debfc3dSmrg // but WITHOUT ANY WARRANTY; without even the implied warranty of
131debfc3dSmrg // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
141debfc3dSmrg // GNU General Public License for more details.
151debfc3dSmrg 
161debfc3dSmrg // Under Section 7 of GPL version 3, you are granted additional
171debfc3dSmrg // permissions described in the GCC Runtime Library Exception, version
181debfc3dSmrg // 3.1, as published by the Free Software Foundation.
191debfc3dSmrg 
201debfc3dSmrg // You should have received a copy of the GNU General Public License and
211debfc3dSmrg // a copy of the GCC Runtime Library Exception along with this program;
221debfc3dSmrg // see the files COPYING3 and COPYING.RUNTIME respectively.  If not, see
231debfc3dSmrg // <http://www.gnu.org/licenses/>.
241debfc3dSmrg 
251debfc3dSmrg /** @file bits/exception_defines.h
261debfc3dSmrg  *  This is an internal header file, included by other library headers.
271debfc3dSmrg  *  Do not attempt to use it directly. @headername{exception}
281debfc3dSmrg  */
291debfc3dSmrg 
301debfc3dSmrg #ifndef _EXCEPTION_DEFINES_H
311debfc3dSmrg #define _EXCEPTION_DEFINES_H 1
321debfc3dSmrg 
331debfc3dSmrg #if ! __cpp_exceptions
341debfc3dSmrg // Iff -fno-exceptions, transform error handling code to work without it.
351debfc3dSmrg # define __try      if (true)
361debfc3dSmrg # define __catch(X) if (false)
371debfc3dSmrg # define __throw_exception_again
381debfc3dSmrg #else
391debfc3dSmrg // Else proceed normally.
401debfc3dSmrg # define __try      try
411debfc3dSmrg # define __catch(X) catch(X)
421debfc3dSmrg # define __throw_exception_again throw
431debfc3dSmrg #endif
441debfc3dSmrg 
451debfc3dSmrg #endif
46