diff --git a/configure.ac b/configure.ac index ae756038e7d..15dc41c55f9 100644 --- a/configure.ac +++ b/configure.ac @@ -5927,7 +5927,7 @@ LIBS="$LIB_PTHREAD $LIB_MATH $LIBS" AC_CHECK_FUNCS([accept4 fchdir gethostname \ getrusage get_current_dir_name \ lrand48 random rint tcdrain trunc \ -select getpagesize setlocale newlocale \ +select getpagesize newlocale \ getrlimit setrlimit shutdown \ pthread_sigmask strsignal setitimer \ sendto recvfrom getsockname getifaddrs freeifaddrs \ diff --git a/src/emacs.c b/src/emacs.c index d8b6da5a65a..77929817447 100644 --- a/src/emacs.c +++ b/src/emacs.c @@ -399,14 +399,6 @@ section of the Emacs manual or the file BUGS.\n" /* True if handling a fatal error already. */ bool fatal_error_in_progress; -#if !HAVE_SETLOCALE -static char * -setlocale (int cat, char const *locale) -{ - return 0; -} -#endif - /* True if the current system locale uses UTF-8 encoding. */ static bool using_utf8 (void) @@ -3268,7 +3260,6 @@ You must run Emacs in batch mode in order to dump it. */) #endif -#if HAVE_SETLOCALE /* Recover from setlocale (LC_ALL, ""). */ void fixup_locale (void) @@ -3288,7 +3279,7 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca *plocale = desired_locale; char const *locale_string = STRINGP (desired_locale) ? SSDATA (desired_locale) : ""; -# ifdef WINDOWSNT +#ifdef WINDOWSNT /* Changing categories like LC_TIME usually requires specifying an encoding suitable for the new locale, but MS-Windows's 'setlocale' will only switch the encoding when LC_ALL is @@ -3297,9 +3288,9 @@ synchronize_locale (int category, Lisp_Object *plocale, Lisp_Object desired_loca numbers is unaffected. */ setlocale (LC_ALL, locale_string); fixup_locale (); -# else /* !WINDOWSNT */ +#else setlocale (category, locale_string); -# endif /* !WINDOWSNT */ +#endif } } @@ -3313,21 +3304,20 @@ synchronize_system_time_locale (void) Vsystem_time_locale); } -# ifdef LC_MESSAGES +#ifdef LC_MESSAGES static Lisp_Object Vprevious_system_messages_locale; -# endif +#endif /* Set system messages locale to match Vsystem_messages_locale, if possible. */ void synchronize_system_messages_locale (void) { -# ifdef LC_MESSAGES +#ifdef LC_MESSAGES synchronize_locale (LC_MESSAGES, &Vprevious_system_messages_locale, Vsystem_messages_locale); -# endif +#endif } -#endif /* HAVE_SETLOCALE */ /* Return a diagnostic string for ERROR_NUMBER, in the wording and encoding appropriate for the current locale. */ diff --git a/src/lisp.h b/src/lisp.h index 59d8e497f13..68b77a88aa7 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -5190,15 +5190,9 @@ extern AVOID terminate_due_to_signal (int, int); #ifdef WINDOWSNT extern Lisp_Object Vlibrary_cache; #endif -#if HAVE_SETLOCALE void fixup_locale (void); void synchronize_system_messages_locale (void); void synchronize_system_time_locale (void); -#else -INLINE void fixup_locale (void) {} -INLINE void synchronize_system_messages_locale (void) {} -INLINE void synchronize_system_time_locale (void) {} -#endif extern char *emacs_strerror (int) ATTRIBUTE_RETURNS_NONNULL; extern void shut_down_emacs (int, Lisp_Object); diff --git a/src/sysdep.c b/src/sysdep.c index 9e4f3b211bb..089fc74deb8 100644 --- a/src/sysdep.c +++ b/src/sysdep.c @@ -4593,15 +4593,11 @@ freelocale (locale_t loc) static char * emacs_setlocale (int category, char const *locale) { -# ifdef HAVE_SETLOCALE errno = 0; char *loc = setlocale (category, locale); if (loc || errno) return loc; errno = EINVAL; -# else - errno = ENOTSUP; -# endif return 0; }