home *** CD-ROM | disk | FTP | other *** search
/ PC Format (South-Africa) 2001 June / PCFJune.iso / Xenon / C++ / FreeCommandLineTools.exe / Include / exceptio.h < prev    next >
Encoding:
C/C++ Source or Header  |  2000-01-31  |  4.5 KB  |  158 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.  * Copyright (c) 1994-1999 Rogue Wave Software, Inc.  All Rights Reserved.
  13.  *
  14.  * This computer software is owned by Rogue Wave Software, Inc. and is
  15.  * protected by U.S. copyright laws and other laws and by international
  16.  * treaties.  This computer software is furnished by Rogue Wave Software,
  17.  * Inc. pursuant to a written license agreement and may be used, copied,
  18.  * transmitted, and stored only in accordance with the terms of such
  19.  * license and with the inclusion of the above copyright notice.  This
  20.  * computer software or any other copies thereof may not be provided or
  21.  * otherwise made available to any other person.
  22.  *
  23.  * U.S. Government Restricted Rights.  This computer software is provided
  24.  * with Restricted Rights.  Use, duplication, or disclosure by the
  25.  * Government is subject to restrictions as set forth in subparagraph (c)
  26.  * (1) (ii) of The Rights in Technical Data and Computer Software clause
  27.  * at DFARS 252.227-7013 or subparagraphs (c) (1) and (2) of the
  28.  * Commercial Computer Software รป Restricted Rights at 48 CFR 52.227-19,
  29.  * as applicable.  Manufacturer is Rogue Wave Software, Inc., 5500
  30.  * Flatiron Parkway, Boulder, Colorado 80301 USA.
  31.  *
  32.  **************************************************************************/
  33.  
  34. #include <stdcomp.h>
  35. #include <rw/stddefs.h>
  36.  
  37. #ifndef __EXCEPT_H // __BORLANDC__
  38. #  include <except.h>
  39. #endif
  40.  
  41. #if !defined(_HPACC_)
  42. #ifndef __RWSTD_EXCEPTION_SEEN
  43.  
  44. #ifndef _RWSTD_EXCEPTION_HANDLER_IN_STD
  45.  
  46. typedef void (*terminate_handler) ();
  47. extern terminate_handler set_terminate(terminate_handler f) _RWSTD_THROW_SPEC_NULL;
  48. extern void terminate( );
  49.  
  50. typedef void (*unexpected_handler) ();
  51. extern unexpected_handler set_unexpected( unexpected_handler f)  _RWSTD_THROW_SPEC_NULL;
  52. extern void unexpected();
  53. extern bool uncaught_exception();
  54.  
  55. #endif /* _RWSTD_EXCEPTION_HANDLER_IN_STD */
  56.  
  57. #ifndef _RWSTD_NO_NAMESPACE 
  58. namespace __rwstd {
  59. #endif
  60.  
  61.   extern const char _RWSTDExportFunc(*) __rw_stdexcept_NoNamedException;
  62.   extern const char _RWSTDExportFunc(*) __rw_stdexcept_BadException;
  63.  
  64. #ifndef _RWSTD_NO_NAMESPACE 
  65. }
  66. #endif
  67.  
  68. //
  69. // Temporarily turn off the warnings under the Borland compiler that
  70. // say 'Functions containing ... cannot be inlined'
  71. //
  72. #if defined(__BORLANDC__)
  73. #pragma option -w-inl
  74. #endif
  75.  
  76. #ifdef _RWSTD_EXCEPTION_DEFINED
  77.  
  78. #include <stdexcept.h>
  79.  
  80. #ifndef _RWSTD_NO_NAMESPACE 
  81. namespace std {
  82. #endif
  83.  
  84. #else
  85.  
  86. #ifndef _RWSTD_NO_NAMESPACE 
  87. namespace std {
  88. #endif
  89.  
  90.   class _RWSTDExport exception     
  91.   {
  92.   public:
  93.     exception () _RWSTD_THROW_SPEC_NULL
  94.     { ; }
  95.     exception (const exception&) _RWSTD_THROW_SPEC_NULL 
  96.     { ; }
  97. #if defined(_MSC_VER) && !defined(__BORLANDC__)
  98.     exception (const char *s) _RWSTD_THROW_SPEC_NULL 
  99.     { ; }
  100. #endif
  101.     exception& operator= (const exception& e)  _RWSTD_THROW_SPEC_NULL
  102.     { return *this; }
  103.     virtual ~exception ()  _RWSTD_THROW_SPEC_NULL;
  104.  
  105.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  106.     { 
  107.       return __RWSTD::__rw_stdexcept_NoNamedException;
  108.     }
  109.   };
  110.  
  111. #endif /* _RWSTD_EXCEPTION_DEFINED */
  112.  
  113. #if !defined(_RWSTD_BAD_EXCEPTION_DEFINED)
  114.   class _RWSTDExport bad_exception : public exception     
  115.   { 
  116.   public:
  117.     bad_exception () _RWSTD_THROW_SPEC_NULL : exception( )
  118.     { ; }
  119.     bad_exception(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  120.     { ; }
  121.     bad_exception& operator=(const bad_exception&) _RWSTD_THROW_SPEC_NULL
  122.     { return *this; }
  123.     virtual ~bad_exception ()  _RWSTD_THROW_SPEC_NULL;
  124.  
  125.     virtual const char * what () const  _RWSTD_THROW_SPEC_NULL
  126.     { 
  127.       return __RWSTD::__rw_stdexcept_BadException;
  128.     }
  129.   };
  130. #endif  /* _RWSTD_BAD_EXCEPTION_DEFINED */
  131.  
  132. #define __RWSTD_EXCEPTION_SEEN
  133.  
  134. #ifndef _RWSTD_NO_NAMESPACE 
  135. #endif
  136.  
  137. //
  138. // Yes, the exception hierarchy has been seen!
  139. //
  140. #endif /*__RWSTD_EXCEPTION_SEEN*/
  141. #else
  142. #include <exception.h>
  143. #define RWSTD_exception exception
  144. #endif /*!defined _HPACC_ */
  145. //
  146. // Yes, the complete file has been processed!
  147. //
  148. #define __STD_EXCEPTION
  149.  
  150. #endif /*__STD_EXCEPTION */
  151.  
  152. #pragma option pop
  153.  
  154. #ifndef __USING_STD_NAMES__
  155.   using namespace std;
  156. #endif
  157.