home *** CD-ROM | disk | FTP | other *** search
/ PC Plus SuperCD (UK) 2000 May / PCP163A.iso / Runimage / Cbuilder4 / Include / EXCEPTIO.H < prev    next >
Encoding:
C/C++ Source or Header  |  1999-01-26  |  5.0 KB  |  166 lines

  1. /* This file is included specially and does not have a normal header guard */
  2. #pragma option push -b -a8 -pc -Vx- -Ve- -w-inl -w-aus -w-sig
  3. // -*- C++ -*-
  4. #ifndef __STD_EXCEPTION
  5.  
  6. /***************************************************************************
  7.  *
  8.  * exception - declarations for the Standard Library exception class
  9.  *
  10.  ***************************************************************************
  11.  *
  12.  * (c) Copyright 1994, 1998 Rogue Wave Software, Inc.
  13.  * ALL RIGHTS RESERVED
  14.  *
  15.  * The software and information contained herein are proprietary to, and
  16.  * comprise valuable trade secrets of, Rogue Wave Software, Inc., which
  17.  * intends to preserve as trade secrets such software and information.
  18.  * This software is furnished pursuant to a written license agreement and
  19.  * may be used, copied, transmitted, and stored only in accordance with
  20.  * the terms of such license and with the inclusion of the above copyright
  21.  * notice.  This software and information or any other copies thereof may
  22.  * not be provided or otherwise made available to any other person.
  23.  *
  24.  * Notwithstanding any other lease or license that may pertain to, or
  25.  * accompany the delivery of, this computer software and information, the
  26.  * rights of the Government regarding its use, reproduction and disclosure
  27.  * are as set forth in Section 52.227-19 of the FARS Computer
  28.  * Software-Restricted Rights clause.
  29.  *
  30.  * Use, duplication, or disclosure by the Government is subject to
  31.  * restrictions as set forth in subparagraph (c)(1)(ii) of the Rights in
  32.  * Technical Data and Computer Software clause at DFARS 252.227-7013.
  33.  * Contractor/Manufacturer is Rogue Wave Software, Inc.,
  34.  * P.O. Box 2328, Corvallis, Oregon 97339.
  35.  *
  36.  * This computer software and information is distributed with "restricted
  37.  * rights."  Use, duplication or disclosure is subject to restrictions as
  38.  * set forth in NASA FAR SUP 18-52.227-79 (April 1985) "Commercial
  39.  * Computer Software-Restricted Rights (April 1985)."  If the Clause at
  40.  * 18-52.227-74 "Rights in Data General" is specified in the contract,
  41.  * then the "Alternate III" clause applies.
  42.  *
  43.  **************************************************************************/
  44.  
  45. #include <stdcomp.h>
  46. #include <rw/stddefs.h>
  47.  
  48. #ifndef __EXCEPT_H
  49. #  include <except.h>
  50. #endif
  51.  
  52. #if !defined(_HPACC_)
  53. #ifndef __RWSTD_EXCEPTION_SEEN
  54.  
  55. #ifndef _RWSTD_EXCEPTION_HANDLER_IN_STD
  56.  
  57. typedef void (*terminate_handler) ();
  58. extern terminate_handler set_terminate(terminate_handler f) _RWSTD_THROW_SPEC_NULL;
  59. extern void terminate( );
  60.  
  61. typedef void (*unexpected_handler) ();
  62. extern unexpected_handler set_unexpected( unexpected_handler f)  _RWSTD_THROW_SPEC_NULL;
  63. extern void unexpected();
  64. extern bool uncaught_exception();
  65.  
  66. #endif /* _RWSTD_EXCEPTION_HANDLER_IN_STD */
  67.  
  68. #ifndef _RWSTD_NO_NAMESPACE
  69. namespace __rwstd {
  70. #endif
  71.  
  72.   extern const char _RWSTDExportFunc(*) __rw_stdexcept_NoNamedException;
  73.   extern const char _RWSTDExportFunc(*) __rw_stdexcept_BadException;
  74.  
  75. #ifndef _RWSTD_NO_NAMESPACE
  76. }
  77. #endif
  78.  
  79. //
  80. // Temporarily turn off the warnings under the Borland compiler that
  81. // say 'Functions containing ... cannot be inlined'
  82. //
  83. #if defined(__BORLANDC__)
  84. #pragma option -w-inl
  85. #endif
  86.  
  87. #ifdef _RWSTD_EXCEPTION_DEFINED
  88.  
  89. #include <stdexcept.h>
  90.  
  91. #ifndef _RWSTD_NO_NAMESPACE
  92. namespace std {
  93. #endif
  94.  
  95. #else
  96.  
  97. #ifndef _RWSTD_NO_NAMESPACE
  98. namespace std {
  99. #endif
  100.  
  101.   class _RWSTDExport exception
  102.   {
  103.   public:
  104.     exception () _RWSTD_THROW_SPEC_NULL
  105.     { ; }
  106.     exception (const exception&) _RWSTD_THROW_SPEC_NULL
  107.     { ; }
  108. #if defined(_MSC_VER) && !defined(__BORLANDC__)
  109.     exception (const char *s) _RWSTD_THROW_SPEC_NULL
  110.     { ; }
  111. #endif
  112.     exception& operator= (const exception& e)  _RWSTD_THROW_SPEC_NULL
  113.     { return *this; }
  114.     virtual ~exception ()  _RWSTD_THROW_SPEC_NULL;
  115.  
  116.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  117.     { 
  118.       return __RWSTD::__rw_stdexcept_NoNamedException;
  119.     }
  120.   };
  121.  
  122. #endif /* _RWSTD_EXCEPTION_DEFINED */
  123.  
  124. #if !defined(_RWSTD_BAD_EXCEPTION_DEFINED)
  125.   class _RWSTDExport bad_exception : public exception     
  126.   { 
  127.   public:
  128.     bad_exception () _RWSTD_THROW_SPEC_NULL : exception( )
  129.     { ; }
  130.     bad_exception(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  131.     { ; }
  132.     bad_exception& operator=(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  133.     { return *this; }
  134.     virtual ~bad_exception ()  _RWSTD_THROW_SPEC_NULL;
  135.  
  136.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  137.     { 
  138.       return __RWSTD::__rw_stdexcept_BadException;
  139.     }
  140.   };
  141. #endif  /* _RWSTD_BAD_EXCEPTION_DEFINED */
  142.  
  143. #define __RWSTD_EXCEPTION_SEEN
  144.  
  145. #ifndef _RWSTD_NO_NAMESPACE 
  146. }
  147. #endif
  148.  
  149. //
  150. // Yes, the exception hierarchy has been seen!
  151. //
  152. #endif /*__RWSTD_EXCEPTION_SEEN*/
  153. #else
  154. #include <exception.h>
  155. #define RWSTD_exception exception
  156. #endif /*!defined _HPACC_ */
  157. //
  158. // Yes, the complete file has been processed!
  159. //
  160. #define __STD_EXCEPTION
  161.  
  162. #endif /*__STD_EXCEPTION */
  163.  
  164. #pragma option pop
  165.  
  166.