From 35dc4784bcee7a42a83cc1dbab13fb82cfcc5803 Mon Sep 17 00:00:00 2001 From: Alan Coopersmith Date: Sat, 16 Nov 2013 20:21:54 -0800 Subject: Drop X_LOCALE fallback for OS'es without setlocale() C89 or bust! This was documented as being needed for "only Lynx, Linux-libc5, OS/2" and has never been enabled in modular builds, since none of those platforms have had anyone step up to add support since the X11R7 conversion to autotools. Mostly performed with unifdef -UX_LOCALE, followed by removal of files left without any purpose, and manual cleanup of remaining references. Signed-off-by: Alan Coopersmith Reviewed-by: Adam Jackson Backported-to-NX-by: Ulrich Sibiller --- nx-X11/lib/X11/SetLocale.c | 51 ---------------------------------------------- 1 file changed, 51 deletions(-) (limited to 'nx-X11/lib/X11/SetLocale.c') diff --git a/nx-X11/lib/X11/SetLocale.c b/nx-X11/lib/X11/SetLocale.c index 9ada0fb90..f4d2aca21 100644 --- a/nx-X11/lib/X11/SetLocale.c +++ b/nx-X11/lib/X11/SetLocale.c @@ -66,56 +66,6 @@ from The Open Group. #define MAXLOCALE 64 /* buffer size of locale name */ -#ifdef X_LOCALE - -/* alternative setlocale() for when the OS does not provide one */ - -char * -_Xsetlocale( - int category, - _Xconst char *name -) -{ - static char *xsl_name; - char *old_name; - XrmMethods methods; - XPointer state; - - if (category != LC_CTYPE && category != LC_ALL) - return NULL; - if (!name) { - if (xsl_name) - return xsl_name; - return "C"; - } - if (!*name) - name = getenv("LC_CTYPE"); - if (!name || !*name) - name = getenv("LANG"); - if (name && strlen(name) >= MAXLOCALE) - name = NULL; - if (!name || !*name || !_XOpenLC((char *) name)) - name = "C"; - old_name = xsl_name; - xsl_name = (char *)name; - methods = _XrmInitParseInfo(&state); - xsl_name = old_name; - if (!methods) - return NULL; - name = (*methods->lcname)(state); - xsl_name = strdup(name); - if (!xsl_name) { - xsl_name = old_name; - (*methods->destroy)(state); - return NULL; - } - if (old_name) - Xfree(old_name); - (*methods->destroy)(state); - return xsl_name; -} - -#else /* X_LOCALE */ #if defined(__DARWIN__) || defined(__APPLE__) || defined(__CYGWIN__) char * @@ -250,4 +200,3 @@ _XlcMapOSLocaleName( return osname; } -#endif /* X_LOCALE */ -- cgit v1.2.3