rayzor

diff src/main.cc @ 18:859ccadca671

portability fixes
author John Tsiombikas <nuclear@member.fsf.org>
date Mon, 14 Apr 2014 18:35:37 +0300
parents 79609d482762
children 252999cd1a3f
line diff
     1.1 --- a/src/main.cc	Mon Apr 14 07:34:45 2014 +0300
     1.2 +++ b/src/main.cc	Mon Apr 14 18:35:37 2014 +0300
     1.3 @@ -103,8 +103,10 @@
     1.4  	signal(SIGILL, sig);
     1.5  	signal(SIGFPE, sig);
     1.6  
     1.7 +#ifdef __WATCOM__
     1.8  	// mask all fpe except invalid op
     1.9  	_control87(~_EM_INVALID, _MCW_EM);
    1.10 +#endif
    1.11  
    1.12  	init_timer(128);
    1.13  
    1.14 @@ -481,10 +483,12 @@
    1.15  	cleanup();
    1.16  	fprintf(stderr, "signal caught: %d\n", s);
    1.17  
    1.18 +#ifdef __WATCOM__
    1.19  	if(s == SIGFPE) {
    1.20  		unsigned int st = _status87();
    1.21  		fprintf(stderr, "fpu status: %x\n", st);
    1.22  	}
    1.23 +#endif
    1.24  
    1.25  	exit(1);
    1.26  }