2001-06-20  David Neary  <dneary@eircom.net>

	* configure.in
	* libgimp/gimpmath.h: Imported fix from bug #51822 into 1.3
	branch. Fix is courtesy of <bugzilla-gnome@thewrittenword.com>.
This commit is contained in:
David Neary 2001-06-20 10:59:57 +00:00 committed by David Neary
parent c66347e934
commit efa7685701
3 changed files with 38 additions and 5 deletions

View File

@ -1,3 +1,9 @@
2001-06-20 David Neary <dneary@eircom.net>
* configure.in
* libgimp/gimpmath.h: Imported fix from bug #51822 into 1.3
branch. Fix is courtesy of <bugzilla-gnome@thewrittenword.com>.
2001-06-18 Austin Donnelly <austin@gimp.org>
* plug-ins/common/newsprint.c: Fix from

View File

@ -142,6 +142,8 @@ fi
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
@ -417,6 +419,20 @@ AC_FUNC_VPRINTF
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])

View File

@ -22,7 +22,13 @@
#ifndef __GIMP_MATH_H__
#define __GIMP_MATH_H__
#ifdef HAVE_MATH_H
#include <math.h>
#endif
#ifdef HAVE_IEEEFP_H
#include <ieeefp.h>
#endif
#ifdef G_OS_WIN32
#include <float.h>
@ -86,16 +92,21 @@ extern "C" {
#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 /* __EMX__ */
#endif /* G_OS_WIN32 */
#endif /* HAVE_ISFINITE */
#endif /* HAVE_FINITE */
#ifdef __cplusplus
}