提交 4350935c 编写于 作者: R Rich Felker

add ABI compat aliases for a number of locale_t functions

上级 a512c7d8
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "locale_impl.h" #include "locale_impl.h"
#include "libc.h"
locale_t duplocale(locale_t old) locale_t duplocale(locale_t old)
{ {
...@@ -9,3 +10,5 @@ locale_t duplocale(locale_t old) ...@@ -9,3 +10,5 @@ locale_t duplocale(locale_t old)
if (new && old != LC_GLOBAL_LOCALE) memcpy(new, old, sizeof *new); if (new && old != LC_GLOBAL_LOCALE) memcpy(new, old, sizeof *new);
return new; return new;
} }
weak_alias(duplocale, __duplocale);
#include <stdlib.h> #include <stdlib.h>
#include "locale_impl.h" #include "locale_impl.h"
#include "libc.h"
void freelocale(locale_t l) void freelocale(locale_t l)
{ {
free(l); free(l);
} }
weak_alias(freelocale, __freelocale);
#include <wctype.h> #include <wctype.h>
#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); return iswctype(c, t);
} }
weak_alias(iswctype_l, __iswctype_l);
#include <stdlib.h> #include <stdlib.h>
#include <string.h> #include <string.h>
#include "locale_impl.h" #include "locale_impl.h"
#include "libc.h"
locale_t newlocale(int mask, const char *name, locale_t base) 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) ...@@ -9,3 +10,5 @@ locale_t newlocale(int mask, const char *name, locale_t base)
if (!base) base = calloc(1, sizeof *base); if (!base) base = calloc(1, sizeof *base);
return base; return base;
} }
weak_alias(newlocale, __newlocale);
#include <wctype.h> #include <wctype.h>
#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); return towlower(c);
} }
weak_alias(towlower_l, __towlower_l);
#include <wctype.h> #include <wctype.h>
#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); return towupper(c);
} }
weak_alias(towupper_l, __towupper_l);
#include "locale_impl.h" #include "locale_impl.h"
#include "pthread_impl.h" #include "pthread_impl.h"
#include "libc.h"
locale_t uselocale(locale_t l) locale_t uselocale(locale_t l)
{ {
...@@ -8,3 +9,5 @@ locale_t uselocale(locale_t l) ...@@ -8,3 +9,5 @@ locale_t uselocale(locale_t l)
if (l) self->locale = l; if (l) self->locale = l;
return old; return old;
} }
weak_alias(uselocale, __uselocale);
#include <wctype.h> #include <wctype.h>
#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); return wctype(s);
} }
weak_alias(wctype_l, __wctype_l);
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册