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

  1. /***
  2. *signal.h - defines signal values and routines
  3. *
  4. *       Copyright (c) 1985-1997, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. *       This file defines the signal values and declares the signal functions.
  8. *       [ANSI/System V]
  9. *
  10. *       [Public]
  11. *
  12. ****/
  13.  
  14. #if     _MSC_VER > 1000
  15. #pragma once
  16. #endif
  17.  
  18. #ifndef _INC_SIGNAL
  19. #define _INC_SIGNAL
  20.  
  21. #if     !defined(_WIN32) && !defined(_MAC)
  22. #error ERROR: Only Mac or Win32 targets supported!
  23. #endif
  24.  
  25.  
  26. #ifdef  __cplusplus
  27. extern "C" {
  28. #endif
  29.  
  30.  
  31.  
  32. /* Define _CRTIMP */
  33.  
  34. #ifndef _CRTIMP
  35. #ifdef  _DLL
  36. #define _CRTIMP __declspec(dllimport)
  37. #else   /* ndef _DLL */
  38. #define _CRTIMP
  39. #endif  /* _DLL */
  40. #endif  /* _CRTIMP */
  41.  
  42. /* Define __cdecl for non-Microsoft compilers */
  43.  
  44. #if     ( !defined(_MSC_VER) && !defined(__cdecl) )
  45. #define __cdecl
  46. #endif
  47.  
  48. /* Define _CRTAPI1 (for compatibility with the NT SDK) */
  49.  
  50. #ifndef _CRTAPI1
  51. #if    _MSC_VER >= 800 && _M_IX86 >= 300
  52. #define _CRTAPI1 __cdecl
  53. #else
  54. #define _CRTAPI1
  55. #endif
  56. #endif
  57.  
  58. #ifndef _SIG_ATOMIC_T_DEFINED
  59. typedef int sig_atomic_t;
  60. #define _SIG_ATOMIC_T_DEFINED
  61. #endif
  62.  
  63. #define NSIG 23     /* maximum signal number + 1 */
  64.  
  65.  
  66. /* Signal types */
  67.  
  68. #define SIGINT          2       /* interrupt */
  69. #define SIGILL          4       /* illegal instruction - invalid function image */
  70. #define SIGFPE          8       /* floating point exception */
  71. #define SIGSEGV         11      /* segment violation */
  72. #define SIGTERM         15      /* Software termination signal from kill */
  73. #define SIGBREAK        21      /* Ctrl-Break sequence */
  74. #define SIGABRT         22      /* abnormal termination triggered by abort call */
  75.  
  76.  
  77. /* signal action codes */
  78.  
  79. #define SIG_DFL (void (__cdecl *)(int))0           /* default signal action */
  80. #define SIG_IGN (void (__cdecl *)(int))1           /* ignore signal */
  81. #define SIG_SGE (void (__cdecl *)(int))3           /* signal gets error */
  82. #define SIG_ACK (void (__cdecl *)(int))4           /* acknowledge */
  83.  
  84.  
  85. /* signal error value (returned by signal call on error) */
  86.  
  87. #define SIG_ERR (void (__cdecl *)(int))-1          /* signal error value */
  88.  
  89.  
  90. /* pointer to exception information pointers structure */
  91.  
  92. #if     defined(_MT) || defined(_DLL)
  93. extern void * * __cdecl __pxcptinfoptrs(void);
  94. #define _pxcptinfoptrs  (*__pxcptinfoptrs())
  95. #else   /* ndef _MT && ndef _DLL */
  96. extern void * _pxcptinfoptrs;
  97. #endif  /* _MT || _DLL */
  98.  
  99.  
  100. /* Function prototypes */
  101.  
  102. _CRTIMP void (__cdecl * __cdecl signal(int, void (__cdecl *)(int)))(int);
  103. _CRTIMP int __cdecl raise(int);
  104.  
  105.  
  106. #ifdef  __cplusplus
  107. }
  108. #endif
  109.  
  110. #endif  /* _INC_SIGNAL */
  111.