mirror of https://github.com/ecmwf/eccodes.git
Add macro to enable floating point exceptions
This commit is contained in:
parent
5796616e20
commit
9c38203426
|
@ -24,6 +24,12 @@
|
|||
#include "jasper/jasper.h"
|
||||
#endif
|
||||
|
||||
#ifdef ENABLE_FLOATING_POINT_EXCEPTIONS
|
||||
#define _GNU_SOURCE
|
||||
#include <fenv.h>
|
||||
int feenableexcept(int excepts);
|
||||
#endif
|
||||
|
||||
GRIB_INLINE static int grib_inline_strcmp(const char* a,const char* b) {
|
||||
if (*a != *b) return 1;
|
||||
while((*a!=0 && *b!=0) && *(a) == *(b) ) {a++;b++;}
|
||||
|
@ -139,6 +145,10 @@ int grib_tool(int argc, char **argv)
|
|||
grib_context* c=grib_context_get_default();
|
||||
options.context=c;
|
||||
|
||||
#ifdef ENABLE_FLOATING_POINT_EXCEPTIONS
|
||||
feenableexcept(FE_ALL_EXCEPT & ~FE_INEXACT);
|
||||
#endif
|
||||
|
||||
if (getenv("DOXYGEN_USAGE") && argc==1 ) usage_doxygen();
|
||||
|
||||
grib_get_runtime_options(argc,argv,&options);
|
||||
|
|
Loading…
Reference in New Issue