home *** CD-ROM | disk | FTP | other *** search
/ Magazyn Internet 2000 May / MICD_2000_05.iso / CBuilder5 / INSTALL / DATA1.CAB / Program_Built_Files / Include / excpt.h < prev    next >
C/C++ Source or Header  |  2000-02-01  |  5KB  |  182 lines

  1. /***
  2. *excpt.h - defines exception values, types and routines
  3. *
  4. *Purpose:
  5. *   This file contains the definitions and prototypes for the compiler-
  6. *   dependent intrinsics, support functions and keywords which implement
  7. *   the structured exception handling extensions.
  8. *
  9. ****/
  10.  
  11. /*
  12.  *      C/C++ Run Time Library - Version 10.0
  13.  *
  14.  *      Copyright (c) 1990, 2000 by Inprise Corporation
  15.  *      All Rights Reserved.
  16.  *
  17.  */
  18.  
  19.  
  20.  
  21.  
  22. #ifndef __EXCPT_H
  23. #pragma option push -b -a8 -pc -A- /*P_O_Push*/
  24. #define __EXCPT_H
  25.  
  26. #ifdef __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30. /*
  31.  * Conditional macro definition for function calling type and variable type
  32.  * qualifiers.
  33.  */
  34. #if   ( (_MSC_VER >= 800) && (_M_IX86 >= 300) ) || defined(__BORLANDC__)
  35.  
  36. /* From WINNT.H */
  37. #define EXCEPTION_CONTINUABLE        0      // Continuable exception
  38. #define EXCEPTION_NONCONTINUABLE     0x1    // Noncontinuable exception
  39. #define EXCEPTION_MAXIMUM_PARAMETERS 15     // maximum number of exception parameters
  40.  
  41. /*
  42.  * Definitions for MS C8-32 (386/486) compiler
  43.  */
  44. #define _CRTAPI1 __cdecl
  45. #define _CRTAPI2 __cdecl
  46.  
  47. #else
  48.  
  49. /*
  50.  * Other compilers (e.g., MIPS)
  51.  */
  52. #define _CRTAPI1
  53. #define _CRTAPI2
  54.  
  55. #endif
  56.  
  57.  
  58. /*
  59.  * Exception disposition return values.
  60.  */
  61. typedef enum _EXCEPTION_DISPOSITION {
  62.     ExceptionContinueExecution,
  63.     ExceptionContinueSearch,
  64.     ExceptionNestedException,
  65.     ExceptionCollidedUnwind
  66. } EXCEPTION_DISPOSITION;
  67.  
  68.  
  69. /*
  70.  * Prototype for SEH support function.
  71.  */
  72.  
  73. #if defined(_M_IX86)
  74.  
  75. /*
  76.  * Declarations to keep MS C 8 (386/486) compiler happy
  77.  */
  78. struct _EXCEPTION_RECORD;
  79. struct _CONTEXT;
  80.  
  81. EXCEPTION_DISPOSITION _CRTAPI2 _except_handler (
  82.         struct _EXCEPTION_RECORD *ExceptionRecord,
  83.         void *EstablisherFrame,
  84.         struct _CONTEXT *ContextRecord,
  85.         void *DispatcherContext
  86.         );
  87.  
  88. #elif defined(_M_MRX000) || defined(_MIPS_) || defined(_ALPHA_)
  89.  
  90. /*
  91.  * Declarations to keep MIPS and ALPHA compiler happy
  92.  */
  93. typedef struct _EXCEPTION_POINTERS *Exception_info_ptr;
  94. struct _EXCEPTION_RECORD;
  95. struct _CONTEXT;
  96. struct _DISPATCHER_CONTEXT;
  97.  
  98.  
  99. EXCEPTION_DISPOSITION __C_specific_handler (
  100.         struct _EXCEPTION_RECORD *ExceptionRecord,
  101.         void *EstablisherFrame,
  102.         struct _CONTEXT *ContextRecord,
  103.         struct _DISPATCHER_CONTEXT *DispatcherContext
  104.         );
  105.  
  106. #endif
  107.  
  108.  
  109. /*
  110.  * Keywords and intrinsics for SEH
  111.  */
  112.  
  113. #if defined(__BORLANDC__)
  114. /*
  115.  * Borland C++
  116.  */
  117.  
  118. /* NOTE: To use the old style structured exception handling routines, include
  119.          the SEHMAP.H header file.
  120. */
  121.  
  122. #  define GetExceptionCode()        __exception_code
  123. #  define GetExceptionInformation() ((PEXCEPTION_POINTERS)__exception_info)
  124. #  define AbnormalTermination()     __abnormal_termination
  125.  
  126.  
  127. #elif     ( _MSC_VER >= 800 )
  128. /*
  129.  * MS C8-32 (386/486)
  130.  */
  131. #define try                             __try
  132. #define except                          __except
  133. #define finally                         __finally
  134. #define leave                           __leave
  135. #define GetExceptionCode                _exception_code
  136. #define exception_code                  _exception_code
  137. #define GetExceptionInformation         (struct _EXCEPTION_POINTERS *)_exception_info
  138. #define exception_info                  (struct _EXCEPTION_POINTERS *)_exception_info
  139. #define AbnormalTermination             _abnormal_termination
  140. #define abnormal_termination            _abnormal_termination
  141.  
  142. unsigned long _CRTAPI1 _exception_code(void);
  143. void *        _CRTAPI1 _exception_info(void);
  144. int           _CRTAPI1 _abnormal_termination(void);
  145.  
  146. #elif defined(_M_MRX000) || defined(_MIPS_) || defined(_ALPHA_)
  147. /*
  148.  * MIPS or ALPHA compiler
  149.  */
  150. #define try                             __builtin_try
  151. #define except                          __builtin_except
  152. #define finally                         __builtin_finally
  153. #define leave                           __builtin_leave
  154. #define GetExceptionCode()              __exception_code
  155. #define exception_code()                __exception_code
  156. #define GetExceptionInformation()       (struct _EXCEPTION_POINTERS *)__exception_info
  157. #define exception_info()                (struct _EXCEPTION_POINTERS *)__exception_info
  158. #define AbnormalTermination()           __abnormal_termination
  159. #define abnormal_termination()          __abnormal_termination
  160.  
  161. extern unsigned long __exception_code;
  162. extern int           __exception_info;
  163. extern int           __abnormal_termination;
  164.  
  165. #endif
  166.  
  167.  
  168. /*
  169.  * Legal values for expression in except().
  170.  */
  171.  
  172. #define EXCEPTION_EXECUTE_HANDLER        1
  173. #define EXCEPTION_CONTINUE_SEARCH        0
  174. #define EXCEPTION_CONTINUE_EXECUTION    -1
  175.  
  176. #ifdef __cplusplus
  177. }
  178. #endif
  179.  
  180. #pragma option pop /*P_O_Pop*/
  181. #endif  /* __EXCPT_H */
  182.