diff options
author | Andy Wingo <wingo@pobox.com> | 2016-06-24 17:52:30 +0200 |
---|---|---|
committer | Andy Wingo <wingo@pobox.com> | 2016-06-24 17:52:30 +0200 |
commit | 6a5b44de683fdcea5aee7a089a294c597db55ca1 (patch) | |
tree | 5ecccffec2a26473f17297c641f51c0d76ce948b | |
parent | 229d062f83d7c79fa08729330406d25755b25080 (diff) | |
download | guile-6a5b44de683fdcea5aee7a089a294c597db55ca1.tar.gz |
Check for strtod_l before using it.
Based on a patch by Andy Stormont <astormont@racktopsystems.com>.
* configure.ac: Check for strtod_l.
* libguile/i18n.c (scm_locale_string_to_integer): Fix style.
(scm_locale_string_to_inexact): Check for strtod_l.
-rw-r--r-- | configure.ac | 2 | ||||
-rw-r--r-- | libguile/i18n.c | 4 |
2 files changed, 3 insertions, 3 deletions
diff --git a/configure.ac b/configure.ac index c9c1795c2..4c78b0712 100644 --- a/configure.ac +++ b/configure.ac @@ -766,7 +766,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \ strdup system usleep atexit on_exit chown link fcntl ttyname getpwent \ getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \ index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \ - strcoll strcoll_l strtol_l newlocale uselocale utimensat \ + strcoll strcoll_l strtod_l strtol_l newlocale uselocale utimensat \ sched_getaffinity sched_setaffinity sendfile]) # Reasons for testing: diff --git a/libguile/i18n.c b/libguile/i18n.c index 84c6bfc58..6f75966a1 100644 --- a/libguile/i18n.c +++ b/libguile/i18n.c @@ -1335,7 +1335,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer", if (c_locale != NULL) { -#if defined(USE_GNU_LOCALE_API) && defined(HAVE_STRTOL_L) +#if defined USE_GNU_LOCALE_API && defined HAVE_STRTOL_L c_result = strtol_l (c_str, &c_endptr, c_base, c_locale); #else RUN_IN_LOCALE_SECTION (c_locale, @@ -1379,7 +1379,7 @@ SCM_DEFINE (scm_locale_string_to_inexact, "locale-string->inexact", if (c_locale != NULL) { -#ifdef USE_GNU_LOCALE_API +#if defined USE_GNU_LOCALE_API && defined HAVE_STRTOD_L c_result = strtod_l (c_str, &c_endptr, c_locale); #else RUN_IN_LOCALE_SECTION (c_locale, |