mirror of
git://gcc.gnu.org/git/gcc.git
synced 2024-12-23 17:19:21 +08:00
5a276a25c6
Tue May 19 12:50:27 1998 Craig Burley <burley@gnu.org> Break up main() into separate .o's so making and linking against shared libraries with non-Fortran main() routines is easier: * Makefile.in (MISC): Add setarg.o and setsig.o. * libF77/Makefile.in (MISC): Ditto. * libF77/setarg.c: New file, contains f_setarg(). * libF77/setsig.c: New file, contains f_setsig(). * libF77/getarg_.c: Rename xarg* to f__xarg*. * libF77/iargc_.c: Ditto From-SVN: r19956
102 lines
1.3 KiB
C
102 lines
1.3 KiB
C
/* Set up the signal behavior. */
|
|
|
|
#include <stdio.h>
|
|
#include "signal1.h"
|
|
|
|
#ifndef SIGIOT
|
|
#ifdef SIGABRT
|
|
#define SIGIOT SIGABRT
|
|
#endif
|
|
#endif
|
|
|
|
#ifndef KR_headers
|
|
#undef VOID
|
|
#include <stdlib.h>
|
|
#endif
|
|
|
|
#ifndef VOID
|
|
#define VOID void
|
|
#endif
|
|
|
|
#ifdef __cplusplus
|
|
extern "C" {
|
|
#endif
|
|
|
|
#ifdef KR_headers
|
|
extern VOID sig_die();
|
|
#define Int /* int */
|
|
#else
|
|
extern void sig_die(char*, int);
|
|
#define Int int
|
|
#endif
|
|
|
|
static VOID sigfdie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("Floating Exception", 1);
|
|
}
|
|
|
|
|
|
static VOID sigidie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("IOT Trap", 1);
|
|
}
|
|
|
|
#ifdef SIGQUIT
|
|
static VOID sigqdie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("Quit signal", 1);
|
|
}
|
|
#endif
|
|
|
|
|
|
static VOID sigindie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("Interrupt", 0);
|
|
}
|
|
|
|
static VOID sigtdie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("Killed", 0);
|
|
}
|
|
|
|
#ifdef SIGTRAP
|
|
static VOID sigtrdie(Sigarg)
|
|
{
|
|
Use_Sigarg;
|
|
sig_die("Trace trap", 1);
|
|
}
|
|
#endif
|
|
|
|
|
|
#ifdef __cplusplus
|
|
}
|
|
#endif
|
|
|
|
void
|
|
f_setsig()
|
|
{
|
|
signal1(SIGFPE, sigfdie); /* ignore underflow, enable overflow */
|
|
#ifdef SIGIOT
|
|
signal1(SIGIOT, sigidie);
|
|
#endif
|
|
#ifdef SIGTRAP
|
|
signal1(SIGTRAP, sigtrdie);
|
|
#endif
|
|
#ifdef SIGQUIT
|
|
if(signal1(SIGQUIT,sigqdie) == SIG_IGN)
|
|
signal1(SIGQUIT, SIG_IGN);
|
|
#endif
|
|
if(signal1(SIGINT, sigindie) == SIG_IGN)
|
|
signal1(SIGINT, SIG_IGN);
|
|
signal1(SIGTERM,sigtdie);
|
|
|
|
#ifdef pdp11
|
|
ldfps(01200); /* detect overflow as an exception */
|
|
#endif
|
|
}
|