blob: 24f073f9fb421878d7c457405b3d2e8b73c9662c [file] [log] [blame]
Patrick Williamsd8c66bc2016-06-20 12:57:21 -05001From 814d6fb6c1f4a544c8fd37f5a390ba020c2d8c85 Mon Sep 17 00:00:00 2001
2From: Khem Raj <raj.khem@gmail.com>
3Date: Sun, 10 Jan 2016 22:28:17 +0000
4Subject: [PATCH] libguile: Check for strtol_l during configure
5
6strtol_l is a gnu extention which may not be available on other linux
7libc implementations e.g. musl. Therefore check for this funciton and
8conditionalize the use of it.
9
10Signed-off-by: Khem Raj <raj.khem@gmail.com>
11---
12Upstream-Status: Pending
13
14 configure.ac | 5 +++--
15 libguile/i18n.c | 2 +-
16 2 files changed, 4 insertions(+), 3 deletions(-)
17
18diff --git a/configure.ac b/configure.ac
19index 3969929..f8a6a1a 100644
20--- a/configure.ac
21+++ b/configure.ac
22@@ -752,7 +752,8 @@ AC_CHECK_HEADERS([assert.h crt_externs.h])
23 # truncate - not in mingw
24 # isblank - available as a GNU extension or in C99
25 # _NSGetEnviron - Darwin specific
26-# strcoll_l, newlocale - GNU extensions (glibc), also available on Darwin
27+# strcoll_l, newlocale, strtol_l - GNU extensions (glibc),
28+# also available on Darwin
29 # fork - unavailable on Windows
30 # utimensat - posix.1-2008
31 # sched_getaffinity, sched_setaffinity - GNU extensions (glibc)
32@@ -768,7 +769,7 @@ AC_CHECK_FUNCS([DINFINITY DQNAN cexp chsize clog clog10 ctermid \
33 getgrent kill getppid getpgrp fork setitimer getitimer strchr strcmp \
34 index bcopy memcpy rindex truncate unsetenv isblank _NSGetEnviron \
35 strcoll strcoll_l newlocale utimensat sched_getaffinity \
36- sched_setaffinity sendfile])
37+ sched_setaffinity sendfile strtol_l])
38
39 AM_CONDITIONAL([BUILD_ICE_9_POPEN],
40 [test "x$enable_posix" = "xyes" && test "x$ac_cv_func_fork" = "xyes"])
41diff --git a/libguile/i18n.c b/libguile/i18n.c
42index 97d44b0..9fb6976 100644
43--- a/libguile/i18n.c
44+++ b/libguile/i18n.c
45@@ -1352,7 +1352,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer",
46
47 if (c_locale != NULL)
48 {
49-#ifdef USE_GNU_LOCALE_API
50+#if defined(USE_GNU_LOCALE_API) && defined(HAVE_STRTOL_L)
51 c_result = strtol_l (c_str, &c_endptr, c_base, c_locale);
52 #else
53 RUN_IN_LOCALE_SECTION (c_locale,
54--
552.7.0
56