home *** CD-ROM | disk | FTP | other *** search
/ Tricks of the Windows Gam…ming Gurus (2nd Edition) / Disc2.iso / vc98 / include / eh.h < prev    next >
C/C++ Source or Header  |  1998-06-16  |  2KB  |  85 lines

  1. /***
  2. *eh.h - User include file for exception handling.
  3. *
  4. *       Copyright (c) 1993-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       User include file for exception handling.
  8. *
  9. *       [Public]
  10. *
  11. ****/
  12.  
  13. #if     _MSC_VER > 1000
  14. #pragma once
  15. #endif
  16.  
  17. #ifndef _INC_EH
  18. #define _INC_EH
  19.  
  20. #if     !defined(_WIN32) && !defined(_MAC)
  21. #error ERROR: Only Mac or Win32 targets supported!
  22. #endif
  23.  
  24.  
  25. #ifdef  _MSC_VER
  26. // Currently, all MS C compilers for Win32 platforms default to 8 byte
  27. // alignment.
  28. #pragma pack(push,8)
  29. #endif  // _MSC_VER
  30.  
  31. #ifndef __cplusplus
  32. #error "eh.h is only for C++!"
  33. #endif
  34.  
  35.  
  36. /* Define _CRTIMP */
  37.  
  38. #ifndef _CRTIMP
  39. #ifdef  _DLL
  40. #define _CRTIMP __declspec(dllimport)
  41. #else   /* ndef _DLL */
  42. #define _CRTIMP
  43. #endif  /* _DLL */
  44. #endif  /* _CRTIMP */
  45.  
  46. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  47.  
  48. #ifndef _CRTAPI1
  49. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  50. #define _CRTAPI1 __cdecl
  51. #else
  52. #define _CRTAPI1
  53. #endif
  54. #endif
  55.  
  56. typedef void (__cdecl *terminate_function)();
  57. typedef void (__cdecl *unexpected_function)();
  58. typedef void (__cdecl *terminate_handler)();
  59. typedef void (__cdecl *unexpected_handler)();
  60.  
  61. #ifndef _MAC
  62. struct _EXCEPTION_POINTERS;
  63. typedef void (__cdecl *_se_translator_function)(unsigned int, struct _EXCEPTION_POINTERS*);
  64. #endif
  65.  
  66. #if     _MSC_VER >= 1200
  67. _CRTIMP __declspec(noreturn) void __cdecl terminate(void);
  68. _CRTIMP __declspec(noreturn) void __cdecl unexpected(void);
  69. #else
  70. _CRTIMP void __cdecl terminate(void);
  71. _CRTIMP void __cdecl unexpected(void);
  72. #endif
  73.  
  74. _CRTIMP terminate_function __cdecl set_terminate(terminate_function);
  75. _CRTIMP unexpected_function __cdecl set_unexpected(unexpected_function);
  76. #ifndef _MAC
  77. _CRTIMP _se_translator_function __cdecl _set_se_translator(_se_translator_function);
  78. #endif
  79.  
  80. #ifdef  _MSC_VER
  81. #pragma pack(pop)
  82. #endif  // _MSC_VER
  83.  
  84. #endif  // _INC_EH
  85.