On Thu, Dec 28, 2000 at 11:49:47AM -0600, Albert Chin-A-Young wrote: > 1. HP-UX 11.00 does not have finite() but does have isfinite() as a > macro in <math.h> Oops. Try this patch instead. -- albert chin (china@xxxxxxxxxxxxxxxxxx) -- snip snip --- configure.in.orig Tue Dec 26 00:58:35 2000 +++ configure.in Thu Dec 28 14:22:02 2000 @@ -138,6 +138,8 @@ changequote([,])dnl +AC_CHECK_HEADERS(math.h ieeefp.h) + dnl DU4 native cc currently needs -std1 for ANSI mode (instead of K&R) AC_MSG_CHECKING([for extra flags to get ANSI library prototypes]) gimp_save_LIBS=$LIBS @@ -348,6 +350,20 @@ AC_FUNC_ALLOCA +dnl Check for finite or isfinite +AC_CHECK_FUNCS(finite, , [ + AC_MSG_CHECKING(for finite in <math.h>) + AC_TRY_LINK([#include <math.h>], [double f = 0.0; finite (f)], [ + AC_DEFINE(HAVE_FINITE) + AC_MSG_RESULT(yes)], [ + AC_MSG_RESULT(no) + AC_MSG_CHECKING(for isfinite in <math.h>) + AC_TRY_LINK([#include <math.h>], [float f = 0.0; isfinite(f)], [ + AC_DEFINE(HAVE_ISFINITE) + AC_MSG_RESULT(yes)], AC_MSG_RESULT(no))])]) +AC_SUBST(HAVE_FINITE) +AC_SUBST(HAVE_ISFINITE) + dnl Check for sys/select.h AC_MSG_CHECKING([fd_set and sys/select]) --- config.h.in.orig Wed Dec 27 21:31:43 2000 +++ config.h.in Thu Dec 28 14:06:00 2000 @@ -186,3 +186,15 @@ /* Define if you have the i library (-li). */ #undef HAVE_LIBI + +/* Define if you have the <math.h> header file. */ +#undef HAVE_MATH_H + +/* Define if you have <ieeefp.h>. */ +#undef HAVE_IEEEFP_H + +/* Define if you have the finite() function. */ +#undef HAVE_FINITE + +/* Define if you have isfinite(). */ +#undef HAVE_ISFINITE --- libgimp/gimpmath.h.orig Wed Dec 27 21:37:51 2000 +++ libgimp/gimpmath.h Thu Dec 28 14:07:54 2000 @@ -24,7 +24,12 @@ #ifndef __GIMPMATH_H__ #define __GIMPMATH_H__ +#ifdef HAVE_MATH_H #include <math.h> +#endif +#ifdef HAVE_IEEEFP_H +#include <ieeefp.h> +#endif #ifdef G_OS_WIN32 #include <float.h> @@ -82,13 +87,19 @@ #define gimp_deg_to_rad(angle) ((angle) * (2.0 * G_PI) / 360.0) #define gimp_rad_to_deg(angle) ((angle) * 360.0 / (2.0 * G_PI)) +#ifdef HAVE_FINITE +#define FINITE(x) finite(x) +#else +#ifdef HAVE_ISFINITE +#define FINITE(x) isfinite(x) +#else #ifdef G_OS_WIN32 #define FINITE(x) _finite(x) #else #ifdef __EMX__ #define FINITE(x) isfinite(x) -#else -#define FINITE(x) finite(x) +#endif +#endif #endif #endif