diff --git a/src/frontend/evaluate.c b/src/frontend/evaluate.c index 902e88fad..b64f01e38 100644 --- a/src/frontend/evaluate.c +++ b/src/frontend/evaluate.c @@ -28,13 +28,13 @@ static char * mkcname(char what, char *v1, char *v2); * be lost, but that's no great loss. */ -static sigjmp_buf matherrbuf; +static JMP_BUF matherrbuf; static RETSIGTYPE sig_matherr(void) { fprintf(cp_err, "Error: argument out of range for math function\n"); - siglongjmp(matherrbuf, 1); + LONGJMP(matherrbuf, 1); } @@ -221,7 +221,7 @@ doop(char what, /* Some of the math routines generate SIGILL if the argument is * out of range. Catch this here. */ - if (sigsetjmp(matherrbuf, 1)) { + if (SETJMP(matherrbuf, 1)) { return (NULL); } (void) signal(SIGILL, (SIGNAL_FUNCTION) sig_matherr); @@ -701,7 +701,7 @@ apply_func(struct func *func, struct pnode *arg) /* Some of the math routines generate SIGILL if the argument is * out of range. Catch this here. */ - if (sigsetjmp(matherrbuf, 1)) { + if (SETJMP(matherrbuf, 1)) { (void) signal(SIGILL, SIG_DFL); return (NULL); } diff --git a/src/frontend/resource.c b/src/frontend/resource.c index 72aa762ee..0237d1395 100644 --- a/src/frontend/resource.c +++ b/src/frontend/resource.c @@ -394,13 +394,13 @@ printres(char *name) #define LOG2_PAGESIZE 8 -static sigjmp_buf env; +static JMP_BUF env; static RETSIGTYPE fault(void) { signal(SIGSEGV, (SIGNAL_FUNCTION) fault); /* SysV style */ - siglongjmp(env, 1); + LONGJMP(env, 1); } static void * @@ -414,9 +414,9 @@ baseaddr(void) if (getenv("SPICE_NO_DATASEG_CHECK")) return 0; -#if defined(__CYGWIN__) || defined(HAS_WINDOWS) || defined(__APPLE__) +#if defined(__CYGWIN__) || defined(__MINGW32__) || defined(HAS_WINDOWS) || defined(__APPLE__) return 0; -#endif +#else low = 0; high = (char *) ((unsigned long) sbrk(0) & ~((1 << LOG2_PAGESIZE) - 1)); @@ -433,13 +433,13 @@ baseaddr(void) break; } - if (sigsetjmp(env, 1)) { + if (SETJMP(env, 1)) { low = at; continue; } else x = *at; - if (sigsetjmp(env, 1)) { + if (SETJMP(env, 1)) { low = at; continue; } else @@ -451,6 +451,8 @@ baseaddr(void) (void) signal(SIGSEGV, (SIGNAL_FUNCTION) orig_signal); return (void *) high; + +#endif } # ifdef notdef diff --git a/src/frontend/signal_handler.c b/src/frontend/signal_handler.c index 7197f131b..c131d0d44 100644 --- a/src/frontend/signal_handler.c +++ b/src/frontend/signal_handler.c @@ -29,7 +29,7 @@ Author: 1985 Wayne A. Christopher, U. C. Berkeley CAD Group #include #endif /* HAVE_BSDEDITLINE */ -extern sigjmp_buf jbuf; +extern JMP_BUF jbuf; /* The (void) signal handlers... SIGINT is the only one that gets reset (by * cshpar) so it is global. They are ifdef BSD because of the sigmask @@ -77,7 +77,7 @@ ft_sigintr(void) cp_resetcontrol(); /* here we jump to the start of command processing in main() after resetting everything. */ - siglongjmp(jbuf, 1); + LONGJMP(jbuf, 1); } @@ -89,7 +89,7 @@ sigfloat(int sig, int code) fperror("Error", code); rewind(cp_out); (void) signal( SIGFPE, (SIGNAL_FUNCTION) sigfloat ); - siglongjmp(jbuf, 1); + LONGJMP(jbuf, 1); } /* This should give a new prompt if cshpar is waiting for input. */ @@ -111,7 +111,7 @@ sigcont(void) { (void) signal(SIGTSTP, (SIGNAL_FUNCTION) sigstop); if (cp_cwait) - siglongjmp(jbuf, 1); + LONGJMP(jbuf, 1); } # endif