| // -*- C++ -*- |
| /*************************************************************************** |
| * |
| * exception - declarations for the Standard Library exception class |
| * |
| * $Id$ |
| * |
| *************************************************************************** |
| * |
| * Licensed to the Apache Software Foundation (ASF) under one or more |
| * contributor license agreements. See the NOTICE file distributed |
| * with this work for additional information regarding copyright |
| * ownership. The ASF licenses this file to you under the Apache |
| * License, Version 2.0 (the "License"); you may not use this file |
| * except in compliance with the License. You may obtain a copy of |
| * the License at |
| * |
| * http://www.apache.org/licenses/LICENSE-2.0 |
| * |
| * Unless required by applicable law or agreed to in writing, software |
| * distributed under the License is distributed on an "AS IS" BASIS, |
| * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or |
| * implied. See the License for the specific language governing |
| * permissions and limitations under the License. |
| * |
| * Copyright 1994-2006 Rogue Wave Software. |
| * |
| **************************************************************************/ |
| |
| #ifndef _RWSTD_EXCEPTION_INCLUDED |
| #define _RWSTD_EXCEPTION_INCLUDED |
| |
| #include <rw/_defs.h> |
| #include <rw/_error.h> |
| |
| |
| #if 0 // def __HP_aCC |
| // HP aCC on HP-UX has <exception.h> whose contents HP prefers to ours |
| // # include </opt/aCC/include/exception.h> |
| # include <exception.h> |
| #else // if defined (__HP_aCC) |
| |
| |
| #if !defined (_RWSTD_NO_STD_EXCEPTION) \ |
| || !defined (_RWSTD_NO_RUNTIME_IN_STD) |
| |
| _RWSTD_NAMESPACE (std) { |
| |
| #endif // _RWSTD_NO_STD_EXCEPTION || !_RWSTD_NO_RUNTIME_IN_STD |
| |
| |
| // 18.6.1 |
| class _RWSTD_EXPORT exception |
| { |
| public: |
| // 18.6.1, p2 |
| exception () _THROWS (()); |
| |
| // 18.6.1, p4 |
| exception (const exception&) _THROWS (()); |
| |
| // 18.6.1, p4 |
| exception& operator= (const exception&) _THROWS (()); |
| |
| // 18.6.1, p6 |
| virtual ~exception () _THROWS (()); |
| |
| // 18.6.1, p8 |
| virtual const char* what () const _THROWS (()); |
| |
| #if defined (_MSC_VER) |
| |
| private: |
| |
| const char *_C_name; |
| int _C_flag; |
| |
| #elif defined (__INTEL_COMPILER) |
| |
| private: |
| |
| const char *_C_name; |
| |
| #endif // _MSC_VER |
| }; |
| |
| |
| #if !defined (_RWSTD_NO_STD_EXCEPTION) \ |
| || !defined (_RWSTD_NO_RUNTIME_IN_STD) |
| |
| } // namespace std |
| |
| #else // if _RWSTD_NO_STD_EXCEPTION && _RWSTD_NO_RUNTIME_IN_STD |
| |
| # ifndef _RWSTD_NO_NAMESPACE |
| |
| namespace std { |
| |
| using ::exception; |
| |
| |
| } // namespace std |
| |
| # endif // _RWSTD_NO_NAMESPACE |
| |
| #endif // _RWSTD_NO_STD_EXCEPTION, _RWSTD_NO_RUNTIME_IN_STD |
| |
| |
| |
| #if !defined (_RWSTD_NO_STD_BAD_EXCEPTION) \ |
| || !defined (_RWSTD_NO_RUNTIME_IN_STD) |
| |
| _RWSTD_NAMESPACE (std) { |
| |
| #endif // _RWSTD_NO_STD_BAD_EXCEPTION || _RWSTD_NO_RUNTIME_IN_STD |
| |
| |
| // 18.6.2.1 |
| class _RWSTD_EXPORT bad_exception: public _STD::exception |
| { |
| public: |
| // 18.6.2.1, p2 |
| bad_exception () _THROWS (()); |
| |
| // 18.6.2.1, p4 |
| bad_exception (const bad_exception&) _THROWS (()); |
| |
| // 18.6.2.1, p4 |
| bad_exception& operator= (const bad_exception&) _THROWS (()); |
| |
| virtual ~bad_exception () _THROWS (()); |
| |
| // 18.6.2.1, p5 |
| virtual const char* what () const _THROWS (()); |
| }; |
| |
| #if !defined (_RWSTD_NO_STD_BAD_EXCEPTION) \ |
| || !defined (_RWSTD_NO_RUNTIME_IN_STD) |
| |
| } // namespace std |
| |
| #else // if _RWSTD_NO_STD_BAD_EXCEPTION && _RWSTD_NO_RUNTIME_IN_STD |
| |
| # ifndef _RWSTD_NO_NAMESPACE |
| |
| namespace std { |
| |
| using ::bad_exception; |
| |
| |
| } // namespace std |
| |
| # endif // _RWSTD_NO_NAMESPACE |
| |
| #endif // _RWSTD_NO_STD_BAD_EXCEPTION, _RWSTD_NO_RUNTIME_IN_STD |
| |
| |
| _RWSTD_NAMESPACE (std) { |
| |
| // 18.6.2.2 |
| typedef void (*unexpected_handler) (); |
| |
| // 18.6.2.3 |
| _RWSTD_EXPORT extern unexpected_handler |
| set_unexpected (unexpected_handler) _THROWS (()); |
| |
| // 18.6.2.4 |
| _RWSTD_EXPORT extern void |
| unexpected () _RWSTD_GNUC_ATTRIBUTE ((__noreturn__)); |
| |
| // 18.6.3.1 |
| typedef void (*terminate_handler) (); |
| |
| // 18.6.3.2 |
| _RWSTD_EXPORT extern terminate_handler |
| set_terminate (terminate_handler) _THROWS (()); |
| |
| // 18.6.3.3 |
| _RWSTD_EXPORT extern void |
| terminate () _RWSTD_GNUC_ATTRIBUTE ((__noreturn__)); |
| |
| // 18.6.4 |
| _RWSTD_EXPORT extern bool |
| uncaught_exception () _THROWS (()); |
| |
| } // namespace std |
| |
| #endif // __HP_aCC |
| |
| #endif // _RWSTD_EXCEPTION_INCLUDED |