From 246d760653a7a0daf393793fb682a1284e274a86 Mon Sep 17 00:00:00 2001 From: Francesco Lannutti Date: Sat, 17 Nov 2012 12:31:10 +0100 Subject: [PATCH] conditional compilation isnan isinf --- configure.ac | 2 ++ src/maths/misc/Makefile.am | 11 +++++++++-- src/maths/misc/isinf.c | 2 -- src/maths/misc/isnan.c | 2 -- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/configure.ac b/configure.ac index bbe597b2e..903707359 100644 --- a/configure.ac +++ b/configure.ac @@ -665,9 +665,11 @@ AC_CHECK_DECLS([isnan], [], [], [[#include ]]) if test "x$ac_cv_have_decl_isinf" != xyes; then AC_CHECK_FUNC([isinf]) fi +AM_CONDITIONAL([HAVE_DECL_ISINF_WANTED], [test "x$ac_cv_have_decl_isinf" = xyes]) if test "x$ac_cv_have_decl_isnan" != xyes; then AC_CHECK_FUNC([isnan]) fi +AM_CONDITIONAL([HAVE_DECL_ISNAN_WANTED], [test "x$ac_cv_have_decl_isnan" = xyes]) # If user enables garbage collection, look for garbage collector if test "x$TCL_PACKAGE_PATH" = x; then diff --git a/src/maths/misc/Makefile.am b/src/maths/misc/Makefile.am index 5f68ef979..3f2a6fb1b 100644 --- a/src/maths/misc/Makefile.am +++ b/src/maths/misc/Makefile.am @@ -9,8 +9,6 @@ libmathmisc_la_SOURCES = \ bernoull.c \ erfc.c \ equality.c \ - isinf.c \ - isnan.c \ logb.c \ scalb.c \ norm.h \ @@ -18,6 +16,15 @@ libmathmisc_la_SOURCES = \ randnumb.c +if !HAVE_DECL_ISINF_WANTED +libmathmisc_la_SOURCES += isinf.c +endif + +if !HAVE_DECL_ISNAN_WANTED +libmathmisc_la_SOURCES += isnan.c +endif + + EXTRA_DIST = test_accuracy.c test_erfc.c AM_CPPFLAGS = @AM_CPPFLAGS@ -I$(top_srcdir)/src/include diff --git a/src/maths/misc/isinf.c b/src/maths/misc/isinf.c index 941ca19d9..e92c8b21a 100644 --- a/src/maths/misc/isinf.c +++ b/src/maths/misc/isinf.c @@ -1,6 +1,5 @@ #include "ngspice/ngspice.h" -#if !HAVE_DECL_ISINF #ifndef HAVE_ISINF #if defined(HAVE_FINITE) @@ -30,4 +29,3 @@ isinf (const double x) #else /* HAVE_ISINF */ int Dummy_Symbol_5; #endif /* HAVE_ISINF */ -#endif /* HAVE_DECL_ISINF */ diff --git a/src/maths/misc/isnan.c b/src/maths/misc/isnan.c index bd709fd2f..8505e90ce 100644 --- a/src/maths/misc/isnan.c +++ b/src/maths/misc/isnan.c @@ -1,6 +1,5 @@ #include "ngspice/ngspice.h" -#if !HAVE_DECL_ISNAN #ifndef HAVE_ISNAN /* isnan (originally) for SOI devices in MINGW32 hvogt (dev.c) */ @@ -48,4 +47,3 @@ isnan(double value) #else /* HAVE_ISNAN */ int Dummy_Symbol_4; #endif /* HAVE_ISNAN */ -#endif /* HAVE_DECL_ISNAN */