signal1.h 842 B

1234567891011121314151617181920212223242526272829303132333435
  1. /* You may need to adjust the definition of signal1 to supply a */
  2. /* cast to the correct argument type. This detail is system- and */
  3. /* compiler-dependent. The #define below assumes signal.h declares */
  4. /* type SIG_PF for the signal function's second argument. */
  5. /* For some C++ compilers, "#define Sigarg_t ..." may be appropriate. */
  6. #include <signal.h>
  7. #ifndef Sigret_t
  8. #define Sigret_t void
  9. #endif
  10. #ifndef Sigarg_t
  11. #ifdef KR_headers
  12. #define Sigarg_t
  13. #else
  14. #define Sigarg_t int
  15. #endif
  16. #endif /*Sigarg_t*/
  17. #ifdef USE_SIG_PF /* compile with -DUSE_SIG_PF under IRIX */
  18. #define sig_pf SIG_PF
  19. #else
  20. typedef Sigret_t (*sig_pf)(Sigarg_t);
  21. #endif
  22. #define signal1(a,b) signal(a,(sig_pf)b)
  23. #ifdef __cplusplus
  24. #define Sigarg ...
  25. #define Use_Sigarg
  26. #else
  27. #define Sigarg Int n
  28. #define Use_Sigarg n = n /* shut up compiler warning */
  29. #endif