From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/1344 Path: news.gmane.org!not-for-mail From: Isaac Dunham Newsgroups: gmane.linux.lib.musl.general Subject: Re: [PATCH 6/10] Provide private versions of locale/ functions Date: Sun, 22 Jul 2012 18:32:01 -0700 Message-ID: <20120722183201.11fe567e@newbook> References: <20120722181332.191d4fa5@newbook> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="MP_/Yf7ylMdSbm5uVVVXneSs/jx" X-Trace: dough.gmane.org 1343007144 9503 80.91.229.3 (23 Jul 2012 01:32:24 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 23 Jul 2012 01:32:24 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-1345-gllmg-musl=m.gmane.org@lists.openwall.com Mon Jul 23 03:32:21 2012 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1St7VS-0002IM-Lj for gllmg-musl@plane.gmane.org; Mon, 23 Jul 2012 03:32:18 +0200 Original-Received: (qmail 17812 invoked by uid 550); 23 Jul 2012 01:32:18 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 17798 invoked from network); 23 Jul 2012 01:32:17 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=lavabit; d=lavabit.com; b=UQzCsnXvB0ZL5eJEuwT8qtITiRbrMZdDXGslqFihnXG0/oJ7/hEpclvQIHL2q12i/e0mVC6Nyn77At3WOxYBxkCKGEHNh1i5ONjJ1mBym/qMyNXtOIa51AhbVIo7rzjhmxKBGKZdQicPY1B9b4yg3Nqx/NrKBxj7ZIcLxr7Lr7Q=; h=Date:From:To:Subject:Message-ID:In-Reply-To:References:X-Mailer:Mime-Version:Content-Type; In-Reply-To: <20120722181332.191d4fa5@newbook> X-Mailer: Claws Mail 3.7.4 (GTK+ 2.20.1; i486-pc-linux-gnu) Xref: news.gmane.org gmane.linux.lib.musl.general:1344 Archived-At: --MP_/Yf7ylMdSbm5uVVVXneSs/jx Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Content-Disposition: inline On Sun, 22 Jul 2012 18:13:32 -0700 Isaac Dunham wrote: > This patch series is basically a reworked version of orc's previous > patch. > From what orc said, the first patch should provide enough to build > Xorg; I haven't tested this yet. > A few more patches are syscall wrappers (splice) or trivial > functions (finite). > Finally, there are several aliases. This renames several functions in locale/ to __*, and weak-aliases to the original names. Mainly useful if they ever do get dragged into the ISO code... Isaac Dunham --MP_/Yf7ylMdSbm5uVVVXneSs/jx Content-Type: text/x-patch Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename=6-__locale.diff diff --git a/src/locale/duplocale.c b/src/locale/duplocale.c index 5f01e13..716df4a 100644 --- a/src/locale/duplocale.c +++ b/src/locale/duplocale.c @@ -1,11 +1,14 @@ #include #include #include "locale_impl.h" +#include "libc.h" -locale_t duplocale(locale_t old) +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; } + +weak_alias(__duplocale, duplocale); diff --git a/src/locale/freelocale.c b/src/locale/freelocale.c index 4e089f2..f35ac46 100644 --- a/src/locale/freelocale.c +++ b/src/locale/freelocale.c @@ -1,7 +1,10 @@ #include #include "locale_impl.h" +#include "libc.h" -void freelocale(locale_t l) +void __freelocale(locale_t l) { free(l); } + +weak_alias(__freelocale, freelocale); diff --git a/src/locale/iswctype_l.c b/src/locale/iswctype_l.c index 1dccef6..c20ef6a 100644 --- a/src/locale/iswctype_l.c +++ b/src/locale/iswctype_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -int iswctype_l(wint_t c, wctype_t t, locale_t l) +int __iswctype_l(wint_t c, wctype_t t, locale_t l) { return iswctype(c, t); } + +weak_alias(__iswctype_l, iswctype_l); diff --git a/src/locale/newlocale.c b/src/locale/newlocale.c index 986e796..447c8fc 100644 --- a/src/locale/newlocale.c +++ b/src/locale/newlocale.c @@ -1,6 +1,7 @@ #include #include #include "locale_impl.h" +#include "libc.h" locale_t newlocale(int mask, const char *name, locale_t base) { @@ -9,3 +10,5 @@ locale_t newlocale(int mask, const char *name, locale_t base) if (!base) base = calloc(1, sizeof *base); return base; } + +weak_alias(newlocale, __newlocale); diff --git a/src/locale/nl_langinfo_l.c b/src/locale/nl_langinfo_l.c index b54db95..3227d63 100644 --- a/src/locale/nl_langinfo_l.c +++ b/src/locale/nl_langinfo_l.c @@ -1,7 +1,10 @@ #include #include +#include "libc.h" -char *nl_langinfo_l(nl_item item, locale_t l) +char *__nl_langinfo_l(nl_item item, locale_t l) { return nl_langinfo(item); } + +weak_alias(__nl_langinfo_l, nl_langinfo_l); diff --git a/src/locale/strcoll_l.c b/src/locale/strcoll_l.c index 7948b0d..2b096db 100644 --- a/src/locale/strcoll_l.c +++ b/src/locale/strcoll_l.c @@ -1,7 +1,10 @@ #include #include +#include "libc.h" -int strcoll_l(const char *l, const char *r, locale_t loc) +int __strcoll_l(const char *l, const char *r, locale_t loc) { return strcoll(l, r); } + +weak_alias(__strcoll_l, strcoll_l); diff --git a/src/locale/strftime_l.c b/src/locale/strftime_l.c index 70b2f15..edda89d 100644 --- a/src/locale/strftime_l.c +++ b/src/locale/strftime_l.c @@ -1,7 +1,10 @@ #include #include +#include "libc.h" -size_t strftime_l(char *s, size_t n, const char *f, const struct tm *tm, locale_t l) +size_t __strftime_l(char *s, size_t n, const char *f, const struct tm *tm, locale_t l) { return strftime(s, n, f, tm); } + +weak_alias(__strftime_l, strftime_l); diff --git a/src/locale/strxfrm_l.c b/src/locale/strxfrm_l.c index 78e5655..788c350 100644 --- a/src/locale/strxfrm_l.c +++ b/src/locale/strxfrm_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -size_t strxfrm_l(char *dest, const char *src, size_t n, locale_t l) +size_t __strxfrm_l(char *dest, const char *src, size_t n, locale_t l) { return strxfrm(dest, src, n); } + +weak_alias(__strxfrm_l, strxfrm_l); diff --git a/src/locale/towlower_l.c b/src/locale/towlower_l.c index 05fcde5..d565316 100644 --- a/src/locale/towlower_l.c +++ b/src/locale/towlower_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -wint_t towlower_l(wint_t c, locale_t l) +wint_t __towlower_l(wint_t c, locale_t l) { return towlower(c); } + +weak_alias(__towlower_l, towlower_l); diff --git a/src/locale/towupper_l.c b/src/locale/towupper_l.c index aa861ae..f843c4f 100644 --- a/src/locale/towupper_l.c +++ b/src/locale/towupper_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -wint_t towupper_l(wint_t c, locale_t l) +wint_t __towupper_l(wint_t c, locale_t l) { return towupper(c); } + +weak_alias(__towupper_l, towupper_l); diff --git a/src/locale/uselocale.c b/src/locale/uselocale.c index 9c79957..a1405c5 100644 --- a/src/locale/uselocale.c +++ b/src/locale/uselocale.c @@ -1,10 +1,13 @@ #include "locale_impl.h" #include "pthread_impl.h" +#include "libc.h" -locale_t uselocale(locale_t l) +locale_t __uselocale(locale_t l) { pthread_t self = pthread_self(); locale_t old = self->locale; if (l) self->locale = l; return old; } + +weak_alias(__uselocale, uselocale); diff --git a/src/locale/wcscoll_l.c b/src/locale/wcscoll_l.c index f257ec8..bf26372 100644 --- a/src/locale/wcscoll_l.c +++ b/src/locale/wcscoll_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -int wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) +int __wcscoll_l(const wchar_t *l, const wchar_t *r, locale_t locale) { return wcscoll(l, r); } + +weak_alias(__wcscoll_l, wcscoll_l); diff --git a/src/locale/wcsxfrm_l.c b/src/locale/wcsxfrm_l.c index 831998e..4f47587 100644 --- a/src/locale/wcsxfrm_l.c +++ b/src/locale/wcsxfrm_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -size_t wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n, locale_t locale) +size_t __wcsxfrm_l(wchar_t *dest, const wchar_t *src, size_t n, locale_t locale) { return wcsxfrm(dest, src, n); } + +weak_alias(__wcsxfrm_l, wcsxfrm_l); diff --git a/src/locale/wctype_l.c b/src/locale/wctype_l.c index 01f9c67..d937275 100644 --- a/src/locale/wctype_l.c +++ b/src/locale/wctype_l.c @@ -1,6 +1,9 @@ #include +#include "libc.h" -wctype_t wctype_l(const char *s, locale_t l) +wctype_t __wctype_l(const char *s, locale_t l) { return wctype(s); } + +weak_alias(__wctype_l, wctype_l); --MP_/Yf7ylMdSbm5uVVVXneSs/jx--