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

  1. /***
  2. *setjmpex.h - definitions/declarations for extended setjmp/longjmp routines
  3. *
  4. *       Copyright (c) 1993-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file causes _setjmpex to be called which will enable safe
  8. *       setjmp/longjmp that work correctly with try/except/finally.
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if _MSC_VER > 1000
  15. #pragma once
  16. #endif  /* _MSC_VER > 1000 */
  17.  
  18. #ifndef _INC_SETJMPEX
  19. #define _INC_SETJMPEX
  20.  
  21. #if !defined (_WIN32) && !defined (_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif  /* !defined (_WIN32) && !defined (_MAC) */
  24.  
  25. #ifndef _CRTBLD
  26. /* This version of the header files is NOT for user programs.
  27.  * It is intended for use when building the C runtimes ONLY.
  28.  * The version intended for public use will not have this message.
  29.  */
  30. #error ERROR: Use of C runtime library internal header file.
  31. #endif  /* _CRTBLD */
  32.  
  33. /*
  34.  * Definitions specific to particular setjmp implementations.
  35.  */
  36.  
  37. #if defined (_M_IX86)
  38.  
  39. /*
  40.  * MS compiler for x86
  41.  */
  42.  
  43. #define setjmp  _setjmp
  44. #define longjmp _longjmpex
  45.  
  46. #elif defined (_M_MRX000)
  47.  
  48. #if _MSC_VER >= 1100
  49. #define _setjmpex _setjmpexVfp
  50. #endif  /* _MSC_VER >= 1100 */
  51.  
  52. #define setjmp _setjmpex
  53.  
  54. #else  /* defined (_M_MRX000) */
  55.  
  56. #define setjmp _setjmpex
  57.  
  58. #endif  /* defined (_M_MRX000) */
  59.  
  60. #include <setjmp.h>
  61.  
  62. #endif  /* _INC_SETJMPEX */
  63.