Add enable/disable floating point exceptions
This commit is contained in:
parent
3fb5724683
commit
310764dcb4
14
debug.cpp
14
debug.cpp
@ -70,3 +70,17 @@ void
|
||||
unusual (void) {
|
||||
panic ("Unusual code path found.");
|
||||
}
|
||||
|
||||
|
||||
#include <fenv.h>
|
||||
|
||||
void
|
||||
enable_fpe (void) {
|
||||
feenableexcept (FE_DIVBYZERO | FE_INVALID);
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
disable_fpe (void) {
|
||||
feenableexcept (0);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user