OGS
DisableFPE.h
Go to the documentation of this file.
1
11
#if !defined(_WIN32) && !defined(__APPLE__)
12
#include <cfenv>
13
14
class
DisableFPE
15
{
16
public
:
17
DisableFPE
()
18
{
19
fegetenv(&
fe_env
);
// Store floating-point exception handling.
20
fesetenv(FE_DFL_ENV);
// Set default environment effectively disabling
21
// exceptions.
22
}
23
24
~DisableFPE
()
25
{
26
fesetenv(&
fe_env
);
// Restore floating-point exception handling.
27
}
28
29
private
:
30
fenv_t
fe_env
;
31
};
32
33
#else
34
35
// No-op for Windows and Apple
36
class
DisableFPE
37
{
38
};
39
40
#endif
DisableFPE
Definition
DisableFPE.h:15
DisableFPE::~DisableFPE
~DisableFPE()
Definition
DisableFPE.h:24
DisableFPE::DisableFPE
DisableFPE()
Definition
DisableFPE.h:17
DisableFPE::fe_env
fenv_t fe_env
Definition
DisableFPE.h:30
BaseLib
DisableFPE.h
Generated by
1.11.0