From: Waldemar Kozaczuk <[email protected]> Committer: Waldemar Kozaczuk <[email protected]> Branch: master
libc: drop setlocale.c and duplocale.c and add __setlocale alias Signed-off-by: Waldemar Kozaczuk <[email protected]> Message-Id: <[email protected]> --- diff --git a/Makefile b/Makefile --- a/Makefile +++ b/Makefile @@ -1009,7 +1009,7 @@ libc += errno/strerror.o musl += locale/catclose.o musl += locale/catgets.o musl += locale/catopen.o -libc += locale/duplocale.o +musl += locale/duplocale.o libc += locale/freelocale.o musl += locale/iconv.o musl += locale/intl.o @@ -1041,7 +1041,7 @@ musl += locale/isxdigit_l.o libc += locale/langinfo.o musl += locale/localeconv.o libc += locale/nl_langinfo_l.o -libc += locale/setlocale.o +musl += locale/setlocale.o musl += locale/strcasecmp_l.o libc += locale/strcoll.o libc += locale/strcoll_l.o diff --git a/libc/aliases.ld b/libc/aliases.ld --- a/libc/aliases.ld +++ b/libc/aliases.ld @@ -26,6 +26,7 @@ __finitel = finitel; /* locale */ __toupper_l = toupper_l; +__setlocale = setlocale; /* multibyte */ __mbrlen = mbrlen; diff --git a/libc/locale/duplocale.c b/libc/locale/duplocale.c --- a/libc/locale/duplocale.c +++ b/libc/locale/duplocale.c @@ -1,15 +0,0 @@ -#include <stdlib.h> -#include <string.h> -#include "locale_impl.h" -#include "libc.h" - -locale_t __duplocale(locale_t old) -{ - locale_t new; - new = calloc(1, sizeof *new); - if (new && old != LC_GLOBAL_LOCALE) memcpy(new, old, sizeof *new); - return new; -} - -/* OSv local: a libstdc++ build against glibc wants the __ version */ -weak_alias(__duplocale, duplocale); diff --git a/libc/locale/setlocale.c b/libc/locale/setlocale.c --- a/libc/locale/setlocale.c +++ b/libc/locale/setlocale.c @@ -1,13 +0,0 @@ -#include <locale.h> -#include "libc.h" - -char *__setlocale(int category, const char *locale) -{ - /* Note: plain "C" would be better, but puts some broken - * software into legacy 8-bit-codepage mode, ignoring - * the standard library's multibyte encoding */ - return "C.UTF-8"; -} - -/* OSv local: a libstdc++ build against glibc wants the __ version */ -weak_alias(__setlocale, setlocale); -- You received this message because you are subscribed to the Google Groups "OSv Development" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To view this discussion on the web visit https://groups.google.com/d/msgid/osv-dev/0000000000003b740205ad476bd5%40google.com.
