From c8199d0f9eb45a99de074ec10b893f737f738cd8 Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Tue, 6 Sep 2011 13:47:45 -0700 Subject: [PATCH] isnan: Fix porting problem to Solaris 10 with bundled gcc. Without this fix, the command to link temacs failed due to an undefined symbol __builtin_isnan. This is because /usr/include/iso/math_c99.h #defines isnan(x) to __builtin_isnan(x), but the bundled gcc, which identifies itself as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have a __builtin_isnan. * configure.in (isnan): Remove now-unnecessary check. * src/floatfns.c (isnan): #undef, and then #define to a clone of what's in data.c. (Fisnan): Always define, since it's always available now. (syms_of_floatfns): Always define isnan at the Lisp level. --- ChangeLog | 4 ++++ configure.in | 2 +- src/ChangeLog | 14 ++++++++++++++ src/floatfns.c | 7 +++++-- 4 files changed, 24 insertions(+), 3 deletions(-) diff --git a/ChangeLog b/ChangeLog index f33d61ef9f1..437c6dba2f1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,7 @@ +2011-09-06 Paul Eggert + + * configure.in (isnan): Remove now-unnecessary check. + 2011-09-06 Paul Eggert Merge from gnulib, using build-aux to remove clutter (Bug#9169). diff --git a/configure.in b/configure.in index a89297854a8..5116648c32a 100644 --- a/configure.in +++ b/configure.in @@ -2708,7 +2708,7 @@ __fpending mblen mbrlen mbsinit strsignal setitimer ualarm \ sendto recvfrom getsockopt setsockopt getsockname getpeername \ gai_strerror mkstemp getline getdelim mremap fsync sync \ difftime mempcpy mblen mbrlen posix_memalign \ -cfmakeraw cfsetspeed isnan copysign __executable_start) +cfmakeraw cfsetspeed copysign __executable_start) dnl Cannot use AC_CHECK_FUNCS AC_CACHE_CHECK([for __builtin_unwind_init], diff --git a/src/ChangeLog b/src/ChangeLog index 6131249beb9..f1691252778 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,17 @@ +2011-09-06 Paul Eggert + + isnan: Fix porting problem to Solaris 10 with bundled gcc. + Without this fix, the command to link temacs failed due to an + undefined symbol __builtin_isnan. This is because + /usr/include/iso/math_c99.h #defines isnan(x) to + __builtin_isnan(x), but the bundled gcc, which identifies itself + as gcc 3.4.3 (csl-sol210-3_4-branch+sol_rpath), does not have + a __builtin_isnan. + * floatfns.c (isnan): #undef, and then #define to a clone of + what's in data.c. + (Fisnan): Always define, since it's always available now. + (syms_of_floatfns): Always define isnan at the Lisp level. + 2011-09-06 Paul Eggert * Makefile.in (gl-stamp): move-if-change now in build-aux (Bug#9169). diff --git a/src/floatfns.c b/src/floatfns.c index 89aa052e8b1..81cf6bdb61f 100644 --- a/src/floatfns.c +++ b/src/floatfns.c @@ -282,7 +282,9 @@ DEFUN ("tan", Ftan, Stan, 1, 1, 0, return make_float (d); } -#if defined HAVE_ISNAN && defined HAVE_COPYSIGN +#undef isnan +#define isnan(x) ((x) != (x)) + DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, doc: /* Return non nil iff argument X is a NaN. */) (Lisp_Object x) @@ -291,6 +293,7 @@ DEFUN ("isnan", Fisnan, Sisnan, 1, 1, 0, return isnan (XFLOAT_DATA (x)) ? Qt : Qnil; } +#ifdef HAVE_COPYSIGN DEFUN ("copysign", Fcopysign, Scopysign, 1, 2, 0, doc: /* Copy sign of X2 to value of X1, and return the result. Cause an error if X1 or X2 is not a float. */) @@ -1030,8 +1033,8 @@ syms_of_floatfns (void) defsubr (&Scos); defsubr (&Ssin); defsubr (&Stan); -#if defined HAVE_ISNAN && defined HAVE_COPYSIGN defsubr (&Sisnan); +#ifdef HAVE_COPYSIGN defsubr (&Scopysign); defsubr (&Sfrexp); defsubr (&Sldexp); -- 2.39.2