guile-commits
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Guile-commits] 02/02: Fix make-polar signedness of zeros on macOS


From: Andy Wingo
Subject: [Guile-commits] 02/02: Fix make-polar signedness of zeros on macOS
Date: Tue, 21 Feb 2017 16:09:49 -0500 (EST)

wingo pushed a commit to branch master
in repository guile.

commit c4b0491e91a7c4d4a2b89511b37eae61e79de47a
Author: Matt Wette <address@hidden>
Date:   Tue Feb 21 22:07:39 2017 +0100

    Fix make-polar signedness of zeros on macOS
    
    * configure.ac: Check for __sincos.
    * libguile/numbers.c (scm_c_make_polar): Fall back to __sincos if
      possible.  Fixes zero signedness of make-polar on macOS.
---
 configure.ac       | 3 ++-
 libguile/numbers.c | 2 ++
 2 files changed, 4 insertions(+), 1 deletion(-)

diff --git a/configure.ac b/configure.ac
index 0201519..8c90d3f 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1152,8 +1152,9 @@ AC_REPLACE_FUNCS([strerror memmove])
 #   asinh, acosh, atanh, trunc - C99 standard, generally not available on
 #                                older systems
 #   sincos - GLIBC extension
+#   __sincos - APPLE extension
 #
-AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos trunc)
+AC_CHECK_FUNCS(asinh acosh atanh copysign finite sincos __sincos trunc)
 
 # C99 specifies isinf and isnan as macros.
 # HP-UX provides only macros, no functions.
diff --git a/libguile/numbers.c b/libguile/numbers.c
index 07170d9..b926d24 100644
--- a/libguile/numbers.c
+++ b/libguile/numbers.c
@@ -9109,6 +9109,8 @@ scm_c_make_polar (double mag, double ang)
      details.  */
 #if (defined HAVE_SINCOS) && (defined __GLIBC__) && (defined _GNU_SOURCE)
   sincos (ang, &s, &c);
+#elif (defined HAVE___SINCOS)
+  __sincos (ang, &s, &c);
 #else
   s = sin (ang);
   c = cos (ang);



reply via email to

[Prev in Thread] Current Thread [Next in Thread]