Commit 0e45f647 authored by Alan Coopersmith's avatar Alan Coopersmith

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's avatarAlan Coopersmith <alan.coopersmith@oracle.com>
Reviewed-by: Adam Jackson's avatarAdam Jackson <ajax@redhat.com>
parent 6cb02b16
......@@ -467,7 +467,6 @@ AC_CONFIG_FILES([Makefile
modules/lc/def/Makefile
modules/lc/gen/Makefile
modules/lc/Utf8/Makefile
modules/lc/xlocale/Makefile
modules/om/Makefile
modules/om/generic/Makefile
src/xkb/Makefile
......
......@@ -32,28 +32,6 @@ from The Open Group.
#include <X11/Xfuncproto.h>
#include <X11/Xosdefs.h>
#ifndef X_LOCALE
#include <locale.h>
#else
#define LC_ALL 0
#define LC_COLLATE 1
#define LC_CTYPE 2
#define LC_MONETARY 3
#define LC_NUMERIC 4
#define LC_TIME 5
_XFUNCPROTOBEGIN
extern char *_Xsetlocale(
int /* category */,
_Xconst char* /* name */
);
_XFUNCPROTOEND
#define setlocale _Xsetlocale
#include <stddef.h>
#endif /* X_LOCALE */
#endif /* _X11_XLOCALE_H_ */
......@@ -39,10 +39,6 @@ PERFORMANCE OF THIS SOFTWARE.
#include "Xlcint.h"
#include "Ximint.h"
#include "XlcPubI.h"
#ifdef X_LOCALE
#define mblen(a,b) _Xmblen(a,b)
extern int _Xmblen ();
#endif
#define sz_CARD8 1
#define sz_INT8 1
......
SUBDIRS=Utf8 def gen xlocale
SUBDIRS=Utf8 def gen
AM_CPPFLAGS= \
-I$(top_srcdir)/include \
-I$(top_srcdir)/include/X11 \
-I$(top_builddir)/include \
-I$(top_builddir)/include/X11 \
-I$(top_srcdir)/src/xcms \
-I$(top_srcdir)/src/xkb \
-I$(top_srcdir)/src/xlibi18n \
-D_BSD_SOURCE
AM_CFLAGS= \
$(X11_CFLAGS) \
$(BIGFONT_CFLAGS) \
$(CWARNFLAGS)
if XLIB_LOADABLE_I18N
commonlibdir = $(X11_LOCALELIBDIR)/common
commonlib_LTLIBRARIES=xlocale.la
xlocale_la_LDFLAGS = -module -version-number 2:0:0
xlocale_la_LIBADD = $(I18N_MODULE_LIBS)
else
noinst_LTLIBRARIES = libxlocale.la
endif
xlocale_la_SOURCES = \
lcEuc.c \
lcJis.c \
lcSjis.c
libxlocale_la_SOURCES = $(xlocale_la_SOURCES)
This diff is collapsed.
This diff is collapsed.
This diff is collapsed.
......@@ -33,10 +33,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -42,10 +42,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -49,10 +49,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -55,10 +55,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -65,10 +65,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -67,10 +67,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -67,10 +67,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -43,10 +43,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -52,9 +52,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -56,10 +56,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -56,10 +56,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -56,10 +56,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -56,10 +56,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -36,10 +36,8 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -51,9 +51,7 @@ wc_encoding_mask \x00008080
wc_shift_bits 8
#endif
#ifndef X_LOCALE
use_stdc_env True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -3,7 +3,6 @@
# XI18N objects table for zh locale
#
#
XLC common/xlocale _XlcEucLoader # XLC_open
XLC common/xlibi18n _XlcGenericLoader # XLC_open
XIM common/ximcp _XimOpenIM _XimRegisterIMInstantiateCallback _XimUnRegisterIMInstantiateCallback # XIM_open XIM_register XIM_unregister
XOM common/xomGeneric _XomGenericOpenOM # XOM_open
......@@ -38,10 +38,8 @@ state_depend_encoding False
wc_encoding_mask \x30000000
wc_shift_bits 7
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -41,10 +41,8 @@ state_depend_encoding False
wc_encoding_mask \x00038000
wc_shift_bits 8
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -82,10 +82,8 @@ state_depend_encoding False
wc_encoding_mask \x3fffc000
wc_shift_bits 7
#ifndef X_LOCALE
use_stdc_env True
force_convert_to_mb True
#endif
XCOMM cs0 class
cs0 {
......
......@@ -248,8 +248,6 @@ Current implementation provides following locale loaders;
<literallayout>
<function>_XlcDefaultLoader</function>
<function>_XlcGenericLoader</function>
<function>_XlcEucLoader</function>
<function>_XlcSjisLoader</function>
<function>_XlcUtfLoader</function>
<function>_XaixOsDynamicLoad</function>
</literallayout>
......
......@@ -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(__APPLE__) || defined(__CYGWIN__)
char *
......@@ -250,4 +200,3 @@ _XlcMapOSLocaleName(
return osname;
}
#endif /* X_LOCALE */
......@@ -35,8 +35,7 @@ IM_LIBS = \
LC_LIBS = \
${top_builddir}/modules/lc/def/libxlcDef.la \
${top_builddir}/modules/lc/gen/libxlibi18n.la \
${top_builddir}/modules/lc/Utf8/libxlcUTF8Load.la \
${top_builddir}/modules/lc/xlocale/libxlocale.la
${top_builddir}/modules/lc/Utf8/libxlcUTF8Load.la
OM_LIBS = \
${top_builddir}/modules/om/generic/libxomGeneric.la
......
......@@ -232,12 +232,6 @@ extern void _XlcGetLocaleDataBase(
int* /* count */
);
#ifdef X_LOCALE
extern char *
_Xsetlocale(
int category,
_Xconst char *name);
#else
#ifdef __APPLE__
extern char *
_Xsetlocale(
......@@ -247,7 +241,6 @@ _Xsetlocale(
extern char *_XlcMapOSLocaleName(
char *osname,
char *siname);
#endif
extern int
_Xmbstoutf8(
......
......@@ -932,21 +932,6 @@ extern XLCd _XlcUtf8Loader(
const char* name
);
/* The old EUC locale loader. */
extern XLCd _XlcEucLoader(
const char* name
);
/* The old SJIS locale loader. */
extern XLCd _XlcSjisLoader(
const char* name
);
/* The old ISO-2022-JP locale loader. */
extern XLCd _XlcJisLoader(
const char* name
);
extern XLCd _XlcDynamicLoad(
const char* name
);
......
......@@ -106,11 +106,6 @@ Sun Microsystems, Inc. or its licensors is granted.
#define USE_GENERIC_LOADER
#define USE_DEFAULT_LOADER
#define USE_UTF8_LOADER
#ifdef X_LOCALE
# define USE_EUC_LOADER
# define USE_SJIS_LOADER
# define USE_JIS_LOADER
#endif
#endif
/*
......@@ -138,18 +133,6 @@ _XlcInitLoader(void)
_XlcAddLoader(_XlcUtf8Loader, XlcHead);
#endif
#ifdef USE_EUC_LOADER
_XlcAddLoader(_XlcEucLoader, XlcHead);
#endif
#ifdef USE_SJIS_LOADER
_XlcAddLoader(_XlcSjisLoader, XlcHead);
#endif
#ifdef USE_JIS_LOADER
_XlcAddLoader(_XlcJisLoader, XlcHead);
#endif
#ifdef USE_DYNAMIC_LOADER
_XlcAddLoader(_XlcDynamicLoader, XlcHead);
#endif
......@@ -177,18 +160,6 @@ _XlcDeInitLoader(void)
_XlcRemoveLoader(_XlcUtf8Loader);
#endif
#ifdef USE_EUC_LOADER
_XlcRemoveLoader(_XlcEucLoader);
#endif
#ifdef USE_SJIS_LOADER
_XlcRemoveLoader(_XlcSjisLoader);
#endif
#ifdef USE_JIS_LOADER
_XlcRemoveLoader(_XlcJisLoader);
#endif
#ifdef USE_DYNAMIC_LOADER
_XlcRemoveLoader(_XlcDynamicLoader);
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment