-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
enable floating point exceptions when debugging (glibc only)
- Loading branch information
Showing
4 changed files
with
24 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
#ifdef DEBUG | ||
#ifdef _WIN32 | ||
#error "enabling floating point exceptions for debugging is not supported on windows" | ||
#endif | ||
#define _GNU_SOURCE | ||
#include <fenv.h> | ||
#endif | ||
|
||
void enable_fp_exceptions() { | ||
#ifdef DEBUG | ||
feenableexcept(FE_DIVBYZERO | FE_OVERFLOW | FE_INVALID); | ||
#endif | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#ifndef JPEG2PNG_FP_EXCEPTIONS_H | ||
#define JPEG2PNG_FP_EXCEPTIONS_H | ||
|
||
void enable_fp_exceptions(void); | ||
|
||
#endif |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters