summaryrefslogtreecommitdiffstats
path: root/stubs
diff options
context:
space:
mode:
authorPeter Jones <pjones@redhat.com>2006-06-29 15:58:41 +0000
committerPeter Jones <pjones@redhat.com>2006-06-29 15:58:41 +0000
commit097e9e63c1431019b1831db549e7f3686aaf34f4 (patch)
tree7156813ee826601375c54ccc3e5a0505fcf5fd08 /stubs
parentb7e280956c9fe359efe6cfd6dbeeb658fbe10465 (diff)
downloadanaconda-097e9e63c1431019b1831db549e7f3686aaf34f4.tar.gz
anaconda-097e9e63c1431019b1831db549e7f3686aaf34f4.tar.xz
anaconda-097e9e63c1431019b1831db549e7f3686aaf34f4.zip
- Fix wide character support (#196099, #186701)
Diffstat (limited to 'stubs')
-rw-r--r--stubs/Makefile4
-rw-r--r--stubs/unicode-lite.c27
2 files changed, 26 insertions, 5 deletions
diff --git a/stubs/Makefile b/stubs/Makefile
index 138c7183a..63b7d8f3f 100644
--- a/stubs/Makefile
+++ b/stubs/Makefile
@@ -8,8 +8,10 @@ TARGETS= $(LIBUTF8)
all: $(TARGETS) libunicode-lite.a
+CFLAGS += -I../wlite/
+
$(LIBUTF8): unicode-lite.c
- gcc -fPIC -shared -o $@ $< -D_FORTIFY_SOURCE=2
+ gcc -fPIC -shared -I../wlite/ -o $@ $< -D_FORTIFY_SOURCE=2
libunicode-lite.a: libunicode-lite.a($(OBJECTS))
diff --git a/stubs/unicode-lite.c b/stubs/unicode-lite.c
index 2d390b54a..a710b7341 100644
--- a/stubs/unicode-lite.c
+++ b/stubs/unicode-lite.c
@@ -18,6 +18,27 @@
#include <stdlib.h>
#include <locale.h>
+#define WLITE_REDEF_STDC 0
+#include <wlite_wchar.h>
+#include <wlite_wctype.h>
+
+
+int wcwidth (wchar_t c) {
+ return wlite_wcwidth(c);
+}
+
+size_t mbrtowc (wchar_t *pwc, const char *s, size_t n, void *ps) {
+ return wlite_mbrtowc (pwc, s, n, ps);
+}
+
+int iswspace (wchar_t c) {
+ return wlite_iswctype((c), wlite_space_);
+}
+
+size_t wcrtomb(char *s, wchar_t wc, void *ps) {
+ return wlite_wcrtomb (s, wc, ps);
+}
+
const char * __dgettext(const char * domainname, const char * msgid) {
return msgid;
}
@@ -36,14 +57,14 @@ strong_alias (__dgettext, dgettext);
strong_alias (__dcgettext, dcgettext);
/* lie to slang to trick it into using unicode chars for linedrawing */
-char * setlocale (int category, const char *locale) {
+char *setlocale (int category, const char *locale) {
if (locale == NULL || *locale == '\0')
return "en_US.UTF-8";
return 0;
}
/* lie to slang some more */
-char * nl_langinfo(int item) {
+char *nl_langinfo(int item) {
return NULL;
}
@@ -53,8 +74,6 @@ char * nl_langinfo(int item) {
void __libc_freeres_fn_section ___nl_locale_subfreeres (void) {}
strong_alias (___nl_locale_subfreeres, _nl_locale_subfreeres);
-void libc_freeres_fn (void * free_mem) {}
-
const char *const _nl_category_names[] = {
[LC_COLLATE] = "LC_COLLATE",
[LC_CTYPE] = "LC_CTYPE",