default-signal.h 1.01 KB
Newer Older
1 2
// default-signal.h - Catch runtime signals and turn them into exceptions.

Tom Tromey committed
3
/* Copyright (C) 1998, 1999, 2000  Free Software Foundation
4 5 6 7 8 9 10 11 12 13

   This file is part of libgcj.

This software is copyrighted work licensed under the terms of the
Libgcj License.  Please consult the file "LIBGCJ_LICENSE" for
details.  */

#ifndef JAVA_SIGNAL_H
#define JAVA_SIGNAL_H 1

Tom Tromey committed
14 15
#ifdef SJLJ_EXCEPTIONS

Tom Tromey committed
16 17
#define HANDLE_SEGV 1
#define HANDLE_FPE 1
Tom Tromey committed
18 19 20 21

#include <signal.h>

#define SIGNAL_HANDLER(_name)			\
22
static void _name (int _dummy __attribute__ ((__unused__)))
Tom Tromey committed
23 24 25 26 27 28 29 30 31 32 33 34 35 36 37

#define INIT_SEGV						\
do								\
  {								\
    signal (SIGSEGV, catch_segv);				\
  }								\
while (0)							
								
#define INIT_FPE						\
do								\
  {								\
    signal (SIGFPE, catch_fpe);					\
  }								\
while (0)

Tom Tromey committed
38
#define MAKE_THROW_FRAME(_exception)  do {} while (0)
Tom Tromey committed
39 40 41

#else /* SJLJ_EXCEPTIONS */

42 43 44
#undef HANDLE_SEGV
#undef HANDLE_FPE

Andrew Haley committed
45 46 47
#define INIT_SEGV   do {} while (0)
#define INIT_FPE   do {} while (0)

Tom Tromey committed
48 49
#endif /* SJLJ_EXCEPTIONS */

50 51
#endif /* JAVA_SIGNAL_H */