try to catch isinf over ieeefp.h
This commit is contained in:
parent
994b00783d
commit
abc18c40f0
|
|
@ -1,6 +1,7 @@
|
|||
2009-01-04 Dietmar Warning
|
||||
* src/math/misc/isinf.c, Makefile.am: a simple (but ugly) workaround for isinf
|
||||
needed by some adms generated models
|
||||
* src/iclude/ngspice.h, missing_math.h: try to catch isinf by ieeefp.h
|
||||
* adms/ekv/amsva/ekv.va: compatibility regarding S/D diode behaviour
|
||||
|
||||
2009-01-02 Dietmar Warning
|
||||
|
|
|
|||
|
|
@ -33,13 +33,17 @@ extern int isnan(double);
|
|||
#endif
|
||||
|
||||
#ifndef HAVE_DECL_ISINF
|
||||
# ifndef HAVE_ISINF
|
||||
# if defined(HAVE_FINITE) && (defined (HAVE_DECL_ISNAN) || defined (HAVE_ISNAN))
|
||||
# define isinf(x) (!finite(x) && !isnan(x))
|
||||
# endif
|
||||
# else
|
||||
extern int isinf(double);
|
||||
# endif
|
||||
#ifndef HAVE_ISINF
|
||||
#if defined(HAVE_FINITE) && (defined (HAVE_DECL_ISNAN) || defined (HAVE_ISNAN))
|
||||
#define isinf(x) (!finite(x) && !isnan(x))
|
||||
#else
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
extern int isinf(double);
|
||||
#endif
|
||||
#endif
|
||||
#else /* HAVE_ISINF */
|
||||
extern int isinf(double);
|
||||
#endif /* HAVE_ISINF */
|
||||
#endif /* HAVE_DECL_ISINF */
|
||||
|
||||
#endif /* MISSING_MATH_H_INCLUDED */
|
||||
|
|
|
|||
|
|
@ -31,6 +31,10 @@
|
|||
#include <math.h>
|
||||
#include <stdio.h>
|
||||
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
#include <ieeefp.h>
|
||||
#endif
|
||||
|
||||
#include "missing_math.h"
|
||||
|
||||
#ifdef STDC_HEADERS
|
||||
|
|
|
|||
|
|
@ -1,26 +1,35 @@
|
|||
#include "ngspice.h"
|
||||
|
||||
/* this is really ugly - but it is a emergency case */
|
||||
|
||||
#ifndef HAVE_DECL_ISINF
|
||||
|
||||
#ifndef HAVE_ISINF
|
||||
|
||||
static int
|
||||
isinf(double x)
|
||||
{
|
||||
volatile double a = x;
|
||||
#ifdef HAVE_IEEEFP_H
|
||||
|
||||
if (a > DBL_MAX)
|
||||
return 1;
|
||||
if (a < -DBL_MAX)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
int isinf(double x) { return !finite(x) && x==x; }
|
||||
|
||||
#else /* HAVE_IEEEFP_H */
|
||||
|
||||
/* this is really ugly - but it is a emergency case */
|
||||
|
||||
static int
|
||||
isinf(double x)
|
||||
{
|
||||
volatile double a = x;
|
||||
|
||||
if (a > DBL_MAX)
|
||||
return 1;
|
||||
if (a < -DBL_MAX)
|
||||
return -1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif /* HAVE_IEEEFP_H */
|
||||
|
||||
/*
|
||||
* end isinf.c
|
||||
*/
|
||||
#else /* HAVE_ISINF */
|
||||
int Dummy_Symbol_5;
|
||||
|
||||
int Dummy_Symbol_5;
|
||||
|
||||
#endif /* HAVE_ISINF */
|
||||
|
||||
#endif /* HAVE_DECL_ISINF */
|
||||
|
|
|
|||
Loading…
Reference in New Issue