GRASS GIS 8 Programmer's Manual  8.2.2dev(2023)-3d2c704037
calc.c
Go to the documentation of this file.
1 
2 #include <unistd.h>
3 #include <signal.h>
4 
5 #include <grass/calc.h>
6 
7 /****************************************************************************/
8 
11 
12 int columns;
13 
14 /****************************************************************************/
15 
16 static void handle_fpe(int n)
17 {
20 }
21 
22 void pre_exec(void)
23 {
24 #ifndef __MINGW32__
25 #ifdef SIGFPE
26  struct sigaction act;
27 
28  act.sa_handler = &handle_fpe;
29  act.sa_flags = 0;
30  sigemptyset(&act.sa_mask);
31 
32  sigaction(SIGFPE, &act, NULL);
33 #endif
34 #endif
35 
37 }
38 
39 void post_exec(void)
40 {
41 #ifndef __MINGW32__
42 #ifdef SIGFPE
43  struct sigaction act;
44 
45  act.sa_handler = SIG_DFL;
46  act.sa_flags = 0;
47  sigemptyset(&act.sa_mask);
48 
49  sigaction(SIGFPE, &act, NULL);
50 #endif
51 #endif
52 }
53 
54 /****************************************************************************/
55 
56 void calc_init(int cols)
57 {
58  columns = cols;
59 }
60 
61 /****************************************************************************/
62 
void post_exec(void)
Definition: calc.c:39
int columns
Definition: calc.c:12
#define NULL
Definition: ccmath.h:32
void calc_init(int cols)
Definition: calc.c:56
void pre_exec(void)
Definition: calc.c:22
volatile int floating_point_exception_occurred
Definition: calc.c:10
volatile int floating_point_exception
Definition: calc.c:9