Bug 1422415 - Part 1: Remove HAVE_SETLOCALE because setlocale() is available on all supported platforms. r=glandium
authorAndré Bargull <andre.bargull@gmail.com>
Fri, 19 Jan 2018 05:19:40 -0800
changeset 401116 68acdee69ce1
parent 401115 d94c15bb4435
child 401117 8b6bb4335d4b
push id99294
push userrgurzau@mozilla.com
push dateSat, 27 Jan 2018 22:25:55 +0000
treeherdermozilla-inbound@8b6bb4335d4b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersglandium
bugs1422415
milestone60.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1422415 - Part 1: Remove HAVE_SETLOCALE because setlocale() is available on all supported platforms. r=glandium
js/src/old-configure.in
js/src/shell/js.cpp
js/src/vm/Runtime.cpp
--- a/js/src/old-configure.in
+++ b/js/src/old-configure.in
@@ -1870,17 +1870,17 @@ if test -n "$MOZ_DEV_EDITION"; then
 fi
 
 dnl ========================================================
 dnl JavaScript shell
 dnl ========================================================
 
 MOZ_CHECK_ALLOCATOR
 
-AC_CHECK_FUNCS(setlocale localeconv)
+AC_CHECK_FUNCS(localeconv)
 
 AC_SUBST(ac_configure_args)
 
 if test -n "$JS_STANDALONE"; then
 MOZ_APP_NAME="mozjs"
 MOZ_APP_VERSION="$MOZILLA_SYMBOLVERSION"
 JS_LIBRARY_NAME="mozjs-$MOZILLA_SYMBOLVERSION"
 else
--- a/js/src/shell/js.cpp
+++ b/js/src/shell/js.cpp
@@ -8956,19 +8956,17 @@ main(int argc, char** argv, char** envp)
 {
     PreInit();
 
     sArgc = argc;
     sArgv = argv;
 
     int result;
 
-#ifdef HAVE_SETLOCALE
     setlocale(LC_ALL, "");
-#endif
 
     // Special-case stdout and stderr. We bump their refcounts to prevent them
     // from getting closed and then having some printf fail somewhere.
     RCFile rcStdout(stdout);
     rcStdout.acquire();
     RCFile rcStderr(stderr);
     rcStderr.acquire();
 
--- a/js/src/vm/Runtime.cpp
+++ b/js/src/vm/Runtime.cpp
@@ -634,22 +634,18 @@ JSRuntime::resetDefaultLocale()
 }
 
 const char*
 JSRuntime::getDefaultLocale()
 {
     if (defaultLocale)
         return defaultLocale;
 
-    const char* locale;
-#ifdef HAVE_SETLOCALE
-    locale = setlocale(LC_ALL, nullptr);
-#else
-    locale = getenv("LANG");
-#endif
+    const char* locale = setlocale(LC_ALL, nullptr);
+
     // convert to a well-formed BCP 47 language tag
     if (!locale || !strcmp(locale, "C"))
         locale = "und";
 
     char* lang = JS_strdup(activeContextFromOwnThread(), locale);
     if (!lang)
         return nullptr;