[Asterisk-code-review] BuildSystem: Detect whether uselocale(.) is available. (asterisk[13])

Alexander Traud asteriskteam at digium.com
Sat Mar 3 06:57:45 CST 2018


Alexander Traud has uploaded this change for review. ( https://gerrit.asterisk.org/8410


Change subject: BuildSystem: Detect whether uselocale(.) is available.
......................................................................

BuildSystem: Detect whether uselocale(.) is available.

ASTERISK-27712
Reported by: Joerg Sonnenberger, D'Arcy Cain

Change-Id: Idf1c9d43617a3e13028b95b313415903d80ef807
---
M configure
M configure.ac
M include/asterisk/autoconfig.h.in
M main/stdtime/localtime.c
4 files changed, 7 insertions(+), 4 deletions(-)



  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/10/8410/1

diff --git a/configure b/configure
index bbd6297..43672d8 100755
--- a/configure
+++ b/configure
@@ -16393,7 +16393,7 @@
 done
 
 
-for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl
+for ac_func in asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl
 do :
   as_ac_var=`$as_echo "ac_cv_func_$ac_func" | $as_tr_sh`
 ac_fn_c_check_func "$LINENO" "$ac_func" "$as_ac_var"
diff --git a/configure.ac b/configure.ac
index 71c70d6..51743c2 100644
--- a/configure.ac
+++ b/configure.ac
@@ -717,7 +717,7 @@
 AC_FUNC_STRTOD
 AC_FUNC_UTIME_NULL
 AC_FUNC_VPRINTF
-AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv utime vasprintf getpeereid sysctl swapctl])
+AC_CHECK_FUNCS([asprintf atexit closefrom dup2 eaccess endpwent euidaccess ffsll ftruncate getcwd gethostbyname gethostname getloadavg gettimeofday glob ioperm inet_ntoa isascii memchr memmove memset mkdir mkdtemp munmap newlocale ppoll putenv re_comp regcomp select setenv socket strcasecmp strcasestr strchr strcspn strdup strerror strlcat strlcpy strncasecmp strndup strnlen strrchr strsep strspn strstr strtod strtol strtold strtoq unsetenv uselocale utime vasprintf getpeereid sysctl swapctl])
 
 AC_MSG_CHECKING(for htonll)
 AC_LINK_IFELSE(
diff --git a/include/asterisk/autoconfig.h.in b/include/asterisk/autoconfig.h.in
index c046253..0615ea7 100644
--- a/include/asterisk/autoconfig.h.in
+++ b/include/asterisk/autoconfig.h.in
@@ -1136,6 +1136,9 @@
 /* Define to 1 if you have the uriparser library library. */
 #undef HAVE_URIPARSER
 
+/* Define to 1 if you have the `uselocale' function. */
+#undef HAVE_USELOCALE
+
 /* Define to 1 if you have the `utime' function. */
 #undef HAVE_UTIME
 
diff --git a/main/stdtime/localtime.c b/main/stdtime/localtime.c
index f8050c9..8b87b26 100644
--- a/main/stdtime/localtime.c
+++ b/main/stdtime/localtime.c
@@ -312,7 +312,7 @@
 static void		sstate_free(struct state *p);
 
 static AST_LIST_HEAD_STATIC(zonelist, state);
-#ifdef HAVE_NEWLOCALE
+#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
 static AST_LIST_HEAD_STATIC(localelist, locale_entry);
 #endif
 
@@ -2364,7 +2364,7 @@
 	return time1(tmp, localsub, 0L, sp);
 }
 
-#ifdef HAVE_NEWLOCALE
+#if defined(HAVE_NEWLOCALE) && defined(HAVE_USELOCALE)
 static struct locale_entry *find_by_locale(locale_t locale)
 {
 	struct locale_entry *cur;

-- 
To view, visit https://gerrit.asterisk.org/8410
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-MessageType: newchange
Gerrit-Change-Id: Idf1c9d43617a3e13028b95b313415903d80ef807
Gerrit-Change-Number: 8410
Gerrit-PatchSet: 1
Gerrit-Owner: Alexander Traud <pabstraud at compuserve.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.digium.com/pipermail/asterisk-code-review/attachments/20180303/e785786a/attachment.html>


More information about the asterisk-code-review mailing list