From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Natanael Copa Newsgroups: gmane.lisp.guile.bugs Subject: bug#20819: [PATCH] i18n: check for non-POSIX strtol_l Date: Mon, 15 Jun 2015 10:05:41 +0200 Message-ID: <1434355541-11017-1-git-send-email-ncopa@alpinelinux.org> NNTP-Posting-Host: plane.gmane.org X-Trace: ger.gmane.org 1434403281 27172 80.91.229.3 (15 Jun 2015 21:21:21 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 15 Jun 2015 21:21:21 +0000 (UTC) Cc: Natanael Copa To: 20819@debbugs.gnu.org Original-X-From: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Mon Jun 15 23:21:10 2015 Return-path: Envelope-to: guile-bugs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Z4bob-0004EY-P9 for guile-bugs@m.gmane.org; Mon, 15 Jun 2015 23:21:09 +0200 Original-Received: from localhost ([::1]:36499 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4boa-0007Ce-PN for guile-bugs@m.gmane.org; Mon, 15 Jun 2015 17:21:08 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:60851) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4WIx-0002Oj-UM for bug-guile@gnu.org; Mon, 15 Jun 2015 11:28:13 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4WIs-00029i-Rj for bug-guile@gnu.org; Mon, 15 Jun 2015 11:28:07 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:40391) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4WIs-00029Y-Nw for bug-guile@gnu.org; Mon, 15 Jun 2015 11:28:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1Z4WIs-0007hd-Ei for bug-guile@gnu.org; Mon, 15 Jun 2015 11:28:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Natanael Copa Original-Sender: "Debbugs-submit" Resent-CC: bug-guile@gnu.org Resent-Date: Mon, 15 Jun 2015 15:28:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 20819 X-GNU-PR-Package: guile X-GNU-PR-Keywords: patch X-Debbugs-Original-To: bug-guile@gnu.org Original-Received: via spool by submit@debbugs.gnu.org id=B.143438205229562 (code B ref -1); Mon, 15 Jun 2015 15:28:02 +0000 Original-Received: (at submit) by debbugs.gnu.org; 15 Jun 2015 15:27:32 +0000 Original-Received: from localhost ([127.0.0.1]:54851 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4WIM-0007gh-Nd for submit@debbugs.gnu.org; Mon, 15 Jun 2015 11:27:31 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:54475) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1Z4Q0P-00057O-Bc for submit@debbugs.gnu.org; Mon, 15 Jun 2015 04:44:33 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Q0J-0006wo-8K for submit@debbugs.gnu.org; Mon, 15 Jun 2015 04:44:28 -0400 Original-Received: from lists.gnu.org ([2001:4830:134:3::11]:52853) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Q0J-0006wk-53 for submit@debbugs.gnu.org; Mon, 15 Jun 2015 04:44:27 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:39736) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Q0H-0002er-Sc for bug-guile@gnu.org; Mon, 15 Jun 2015 04:44:27 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Z4Q0D-0006t8-Rz for bug-guile@gnu.org; Mon, 15 Jun 2015 04:44:25 -0400 Original-Received: from [79.160.13.133] (port=58386 helo=tanael.org) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Z4Q0D-0006rp-KW for bug-guile@gnu.org; Mon, 15 Jun 2015 04:44:21 -0400 Original-Received: by tanael.org (Postfix, from userid 1001) id 05C42F6E23; Mon, 15 Jun 2015 10:05:49 +0200 (CEST) X-Mailer: git-send-email 2.4.3 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Mailman-Approved-At: Mon, 15 Jun 2015 11:27:29 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x X-Received-From: 140.186.70.43 X-Mailman-Approved-At: Mon, 15 Jun 2015 17:21:06 -0400 X-BeenThere: bug-guile@gnu.org List-Id: "Bug reports for GUILE, GNU's Ubiquitous Extension Language" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Original-Sender: bug-guile-bounces+guile-bugs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.bugs:7792 Archived-At: * configure.ac: Check for strtol_l * libguile/i18n.c: Check with HAVE_STRTOL_L before using strtol_l. This fixes build with musl libc. --- configure.ac | 5 +++-- libguile/i18n.c | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/configure.ac b/configure.ac index 19e00d8..b73a0db 100644 --- a/configure.ac +++ b/configure.ac @@ -752,6 +752,7 @@ AC_CHECK_HEADERS([assert.h crt_externs.h]) # isblank - available as a GNU extension or in C99 # _NSGetEnviron - Darwin specific # strcoll_l, newlocale, uselocale, utimensat - POSIX.1-2008 +# strtol_l - non-POSIX, found in glibc and BSD # fork - unavailable on Windows # sched_getaffinity, sched_setaffinity - GNU extensions (glibc) # sendfile - non-POSIX, found in glibc @@ -765,8 +766,8 @@ 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 newlocale uselocale utimensat sched_getaffinity \ - sched_setaffinity sendfile]) + strcoll strcoll_l strtol_l newlocale uselocale utimensat \ + sched_getaffinity sched_setaffinity sendfile]) # Reasons for testing: # netdb.h - not in mingw diff --git a/libguile/i18n.c b/libguile/i18n.c index f0e3443..17e9eca 100644 --- a/libguile/i18n.c +++ b/libguile/i18n.c @@ -1373,7 +1373,7 @@ SCM_DEFINE (scm_locale_string_to_integer, "locale-string->integer", if (c_locale != NULL) { -#ifdef USE_GNU_LOCALE_API +#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, -- 2.4.3