default-signal.h 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. // default-signal.h - Catch runtime signals and turn them into exceptions.
  2. /* Copyright (C) 1998, 1999, 2000 Free Software Foundation
  3. This file is part of libgcj.
  4. This software is copyrighted work licensed under the terms of the
  5. Libgcj License. Please consult the file "LIBGCJ_LICENSE" for
  6. details. */
  7. #ifndef JAVA_SIGNAL_H
  8. #define JAVA_SIGNAL_H 1
  9. #ifdef SJLJ_EXCEPTIONS
  10. #define HANDLE_SEGV 1
  11. #define HANDLE_FPE 1
  12. #include <signal.h>
  13. #define SIGNAL_HANDLER(_name) \
  14. static void _name (int _dummy __attribute__ ((__unused__)))
  15. #define INIT_SEGV \
  16. do \
  17. { \
  18. signal (SIGSEGV, catch_segv); \
  19. } \
  20. while (0)
  21. #define INIT_FPE \
  22. do \
  23. { \
  24. signal (SIGFPE, catch_fpe); \
  25. } \
  26. while (0)
  27. #define MAKE_THROW_FRAME(_exception) do {} while (0)
  28. #else /* SJLJ_EXCEPTIONS */
  29. #undef HANDLE_SEGV
  30. #undef HANDLE_FPE
  31. #define INIT_SEGV do {} while (0)
  32. #define INIT_FPE do {} while (0)
  33. #endif /* SJLJ_EXCEPTIONS */
  34. #endif /* JAVA_SIGNAL_H */