Paul Eggert wrote: > The localcharset test slows down 'configure' and > does not affect how the code actually behaves. OK to install this? > > 2006-10-17 Paul Eggert <[EMAIL PROTECTED]> > > Simplify localcharset code a bit and speed up configuration > by removing test for setlocale. > * lib/localcharset.c: Do not include <locale.h> or > check HAVE_SETLOCALE, since the code never invokes setlocale > anyway. This change doesn't affect runtime behavior. > * m4/localcharset.m4 (gl_LOCALCHARSET): Don't check for setlocale.
Thanks for the patch. I prefer to keep the comments in place, in a #if 0. So I committed this: 2006-10-17 Paul Eggert <[EMAIL PROTECTED]> * lib/localcharset.c: Do not check HAVE_SETLOCALE. * m4/localcharset.m4 (gl_LOCALCHARSET): Don't check for setlocale. diff -c -3 -r1.25 localcharset.c *** lib/localcharset.c 14 Sep 2006 14:18:36 -0000 1.25 --- lib/localcharset.c 18 Oct 2006 12:02:24 -0000 *************** *** 41,47 **** # if HAVE_LANGINFO_CODESET # include <langinfo.h> # else ! # if HAVE_SETLOCALE # include <locale.h> # endif # endif --- 41,47 ---- # if HAVE_LANGINFO_CODESET # include <langinfo.h> # else ! # if 0 /* see comment below */ # include <locale.h> # endif # endif *************** *** 351,357 **** (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ ! # if HAVE_SETLOCALE && 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') --- 351,357 ---- (like SunOS 4 or DJGPP) have only the C locale. Therefore we don't use setlocale here; it would return "C" when it doesn't support the locale name the user has set. */ ! # if 0 locale = setlocale (LC_CTYPE, NULL); # endif if (locale == NULL || locale[0] == '\0') diff -c -3 -r1.5 localcharset.m4 *** m4/localcharset.m4 31 Jul 2006 16:09:08 -0000 1.5 --- m4/localcharset.m4 18 Oct 2006 12:02:24 -0000 *************** *** 1,4 **** ! # localcharset.m4 serial 4 dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, --- 1,4 ---- ! # localcharset.m4 serial 5 dnl Copyright (C) 2002, 2004, 2006 Free Software Foundation, Inc. dnl This file is free software; the Free Software Foundation dnl gives unlimited permission to copy and/or distribute it, *************** *** 9,15 **** dnl Prerequisites of lib/localcharset.c. AC_REQUIRE([AM_LANGINFO_CODESET]) AC_CHECK_DECLS_ONCE(getc_unlocked) - AC_CHECK_FUNCS_ONCE(setlocale) dnl Prerequisites of the lib/Makefile.am snippet. AC_REQUIRE([AC_CANONICAL_HOST]) --- 9,14 ----