summaryrefslogtreecommitdiff
path: root/libc/misc
diff options
context:
space:
mode:
Diffstat (limited to 'libc/misc')
-rw-r--r--libc/misc/ctype/ctype.c9
-rw-r--r--libc/misc/dirent/dirfd.c3
-rw-r--r--libc/misc/internals/__uClibc_main.c6
-rw-r--r--libc/misc/locale/locale.c17
-rw-r--r--libc/misc/mntent/mntent.c7
-rw-r--r--libc/misc/search/hsearch_r.c7
-rw-r--r--libc/misc/search/tsearch.c7
-rw-r--r--libc/misc/statfs/fstatfs64.c3
-rw-r--r--libc/misc/statfs/statfs64.c3
-rw-r--r--libc/misc/time/time.c38
-rw-r--r--libc/misc/wchar/wchar.c21
-rw-r--r--libc/misc/wctype/wctype.c10
12 files changed, 68 insertions, 63 deletions
diff --git a/libc/misc/ctype/ctype.c b/libc/misc/ctype/ctype.c
index 3f7bfd859..6589e4177 100644
--- a/libc/misc/ctype/ctype.c
+++ b/libc/misc/ctype/ctype.c
@@ -270,6 +270,7 @@ IS_FUNC_BODY(xdigit);
#ifdef L_tolower
#undef tolower
+libc_hidden_proto(tolower)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int tolower(int c)
@@ -288,7 +289,6 @@ int tolower(int c)
}
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-libc_hidden_proto(tolower)
libc_hidden_def(tolower)
#endif
@@ -296,6 +296,7 @@ libc_hidden_def(tolower)
#ifdef L_tolower_l
#undef tolower_l
+libc_hidden_proto(tolower_l)
int tolower_l(int c, __locale_t l)
{
#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
@@ -303,7 +304,6 @@ int tolower_l(int c, __locale_t l)
#endif
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_tolower[c] : c;
}
-libc_hidden_proto(tolower_l)
libc_hidden_def(tolower_l)
#endif
@@ -311,6 +311,7 @@ libc_hidden_def(tolower_l)
#ifdef L_toupper
#undef toupper
+libc_hidden_proto(toupper)
#ifdef __UCLIBC_HAS_CTYPE_TABLES__
int toupper(int c)
@@ -329,7 +330,6 @@ int toupper(int c)
}
#endif /* __UCLIBC_HAS_CTYPE_TABLES__ */
-libc_hidden_proto(toupper)
libc_hidden_def(toupper)
#endif
@@ -337,6 +337,7 @@ libc_hidden_def(toupper)
#ifdef L_toupper_l
#undef toupper_l
+libc_hidden_proto(toupper_l)
int toupper_l(int c, __locale_t l)
{
#if defined(__UCLIBC_HAS_CTYPE_ENFORCED__)
@@ -344,8 +345,6 @@ int toupper_l(int c, __locale_t l)
#endif
return __UCLIBC_CTYPE_IN_TO_DOMAIN(c) ? l->__ctype_toupper[c] : c;
}
-
-libc_hidden_proto(toupper_l)
libc_hidden_def(toupper_l)
#endif
diff --git a/libc/misc/dirent/dirfd.c b/libc/misc/dirent/dirfd.c
index 236614642..c6f46e965 100644
--- a/libc/misc/dirent/dirfd.c
+++ b/libc/misc/dirent/dirfd.c
@@ -8,6 +8,8 @@
#include <errno.h>
#include "dirstream.h"
+libc_hidden_proto(dirfd)
+
int dirfd(DIR * dir)
{
if (!dir || dir->dd_fd == -1) {
@@ -17,5 +19,4 @@ int dirfd(DIR * dir)
return dir->dd_fd;
}
-libc_hidden_proto(dirfd)
libc_hidden_def(dirfd)
diff --git a/libc/misc/internals/__uClibc_main.c b/libc/misc/internals/__uClibc_main.c
index 9987324b2..349c0e5d1 100644
--- a/libc/misc/internals/__uClibc_main.c
+++ b/libc/misc/internals/__uClibc_main.c
@@ -93,8 +93,9 @@ char **__environ = 0;
weak_alias(__environ, environ)
/* TODO: don't export __pagesize; we cant now because libpthread uses it */
-size_t __pagesize = 0;
+extern size_t __pagesize;
libc_hidden_proto(__pagesize)
+size_t __pagesize = 0;
libc_hidden_def(__pagesize)
#ifndef O_NOFOLLOW
@@ -152,6 +153,8 @@ static int __check_suid(void)
* __uClibc_main.
*/
+extern void __uClibc_init(void);
+libc_hidden_proto(__uClibc_init)
void __uClibc_init(void)
{
static int been_there_done_that = 0;
@@ -199,7 +202,6 @@ void __uClibc_init(void)
_stdio_init();
}
-libc_hidden_proto(__uClibc_init)
libc_hidden_def(__uClibc_init)
#ifdef __UCLIBC_CTOR_DTOR__
diff --git a/libc/misc/locale/locale.c b/libc/misc/locale/locale.c
index 28ebb3fb2..c32d09722 100644
--- a/libc/misc/locale/locale.c
+++ b/libc/misc/locale/locale.c
@@ -1012,6 +1012,7 @@ static const unsigned char nl_data[C_LC_ALL + 1 + 90 + 320] = {
']', '\x00', '^', '[', 'n', 'N', ']', '\x00',
};
+libc_hidden_proto(nl_langinfo)
char *nl_langinfo(nl_item item)
{
unsigned int c;
@@ -1025,24 +1026,26 @@ char *nl_langinfo(nl_item item)
}
return (char *) cat_start; /* Conveniently, this is the empty string. */
}
-libc_hidden_proto(nl_langinfo)
libc_hidden_def(nl_langinfo)
#else /* __LOCALE_C_ONLY */
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(nl_langinfo)
+
libc_hidden_proto(nl_langinfo_l)
char *nl_langinfo(nl_item item)
{
return nl_langinfo_l(item, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(nl_langinfo)
libc_hidden_def(nl_langinfo)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(nl_langinfo))
+
static const char empty[] = "";
char *__XL_NPP(nl_langinfo)(nl_item item __LOCALE_PARAM )
@@ -1057,7 +1060,6 @@ char *__XL_NPP(nl_langinfo)(nl_item item __LOCALE_PARAM )
return (char *) empty;
}
-libc_hidden_proto(__XL_NPP(nl_langinfo))
libc_hidden_def(__XL_NPP(nl_langinfo))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
@@ -1068,6 +1070,8 @@ libc_hidden_def(__XL_NPP(nl_langinfo))
/**********************************************************************/
#ifdef L_newlocale
+libc_hidden_proto(newlocale)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning TODO: Move posix and utf8 strings.
#endif
@@ -1305,13 +1309,14 @@ __locale_t newlocale(int category_mask, const char *locale, __locale_t base)
return base;
}
-libc_hidden_proto(newlocale)
libc_hidden_def(newlocale)
#endif
/**********************************************************************/
#ifdef L_duplocale
+libc_hidden_proto(duplocale)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: When we allocate ctype tables, remember to dup them.
#endif
@@ -1339,7 +1344,6 @@ __locale_t duplocale(__locale_t dataset)
}
return r;
}
-libc_hidden_proto(duplocale)
libc_hidden_def(duplocale)
#endif
@@ -1363,6 +1367,8 @@ void freelocale(__locale_t dataset)
/**********************************************************************/
#ifdef L_uselocale
+libc_hidden_proto(uselocale)
+
__locale_t uselocale(__locale_t dataset)
{
__locale_t old;
@@ -1386,7 +1392,6 @@ __locale_t uselocale(__locale_t dataset)
}
return old;
}
-libc_hidden_proto(uselocale)
libc_hidden_def(uselocale)
#endif
diff --git a/libc/misc/mntent/mntent.c b/libc/misc/mntent/mntent.c
index f9734fce5..3164f6634 100644
--- a/libc/misc/mntent/mntent.c
+++ b/libc/misc/mntent/mntent.c
@@ -9,6 +9,10 @@
#include <string.h>
#include <mntent.h>
+libc_hidden_proto(getmntent_r)
+libc_hidden_proto(setmntent)
+libc_hidden_proto(endmntent)
+
libc_hidden_proto(strstr)
libc_hidden_proto(strtok_r)
libc_hidden_proto(atoi)
@@ -74,7 +78,6 @@ struct mntent *getmntent_r (FILE *filep,
return mnt;
}
-libc_hidden_proto(getmntent_r)
libc_hidden_def(getmntent_r)
struct mntent *getmntent(FILE * filep)
@@ -116,7 +119,6 @@ FILE *setmntent(const char *name, const char *mode)
{
return fopen(name, mode);
}
-libc_hidden_proto(setmntent)
libc_hidden_def(setmntent)
int endmntent(FILE * filep)
@@ -125,5 +127,4 @@ int endmntent(FILE * filep)
fclose(filep);
return 1;
}
-libc_hidden_proto(endmntent)
libc_hidden_def(endmntent)
diff --git a/libc/misc/search/hsearch_r.c b/libc/misc/search/hsearch_r.c
index 47ff185d4..e7ded795f 100644
--- a/libc/misc/search/hsearch_r.c
+++ b/libc/misc/search/hsearch_r.c
@@ -27,6 +27,10 @@
#include <search.h>
+libc_hidden_proto(hcreate_r)
+libc_hidden_proto(hdestroy_r)
+libc_hidden_proto(hsearch_r)
+
/* [Aho,Sethi,Ullman] Compilers: Principles, Techniques and Tools, 1986
[Knuth] The Art of Computer Programming, part 3 (6.4) */
@@ -96,7 +100,6 @@ int hcreate_r (size_t nel, struct hsearch_data *htab)
/* everything went alright */
return 1;
}
-libc_hidden_proto(hcreate_r)
libc_hidden_def(hcreate_r)
#endif
@@ -119,7 +122,6 @@ void hdestroy_r (struct hsearch_data *htab)
/* the sign for an existing table is an value != NULL in htable */
htab->table = NULL;
}
-libc_hidden_proto(hdestroy_r)
libc_hidden_def(hdestroy_r)
#endif
@@ -230,6 +232,5 @@ int hsearch_r (ENTRY item, ACTION action, ENTRY **retval,
*retval = NULL;
return 0;
}
-libc_hidden_proto(hsearch_r)
libc_hidden_def(hsearch_r)
#endif
diff --git a/libc/misc/search/tsearch.c b/libc/misc/search/tsearch.c
index 47d409468..d66a5c422 100644
--- a/libc/misc/search/tsearch.c
+++ b/libc/misc/search/tsearch.c
@@ -32,6 +32,10 @@ Cambridge, MA 02139, USA. */
#include <search.h>
#include <stdlib.h>
+libc_hidden_proto(tsearch)
+libc_hidden_proto(tfind)
+libc_hidden_proto(tdestroy)
+
/* This routine is not very bad. It makes many assumptions about
* the compiler. It assumpts that the first field in node must be
* the "key" field, which points to the datum. It is a very trick
@@ -77,7 +81,6 @@ void *tsearch(__const void *key, void **vrootp, __compar_fn_t compar)
}
return (q);
}
-libc_hidden_proto(tsearch)
libc_hidden_def(tsearch)
#endif
@@ -100,7 +103,6 @@ void *tfind(__const void *key, void * __const *vrootp, __compar_fn_t compar)
}
return NULL;
}
-libc_hidden_proto(tfind)
libc_hidden_def(tfind)
#endif
@@ -215,7 +217,6 @@ void tdestroy (void *vroot, __free_fn_t freefct)
tdestroy_recurse (root, freefct);
}
}
-libc_hidden_proto(tdestroy)
libc_hidden_def(tdestroy)
#endif
diff --git a/libc/misc/statfs/fstatfs64.c b/libc/misc/statfs/fstatfs64.c
index 89ab5107d..291b8719d 100644
--- a/libc/misc/statfs/fstatfs64.c
+++ b/libc/misc/statfs/fstatfs64.c
@@ -38,6 +38,8 @@
#include <sys/statvfs.h>
#include <stddef.h>
+libc_hidden_proto(fstatfs64)
+
libc_hidden_proto(memcpy)
libc_hidden_proto(fstatfs)
@@ -62,5 +64,4 @@ int fstatfs64 (int fd, struct statfs64 *buf)
return 0;
}
-libc_hidden_proto(fstatfs64)
libc_hidden_def(fstatfs64)
diff --git a/libc/misc/statfs/statfs64.c b/libc/misc/statfs/statfs64.c
index 230b89b9c..e8d2c13d7 100644
--- a/libc/misc/statfs/statfs64.c
+++ b/libc/misc/statfs/statfs64.c
@@ -36,6 +36,8 @@
#include <stddef.h>
#include <sys/statfs.h>
+libc_hidden_proto(statfs64)
+
libc_hidden_proto(memcpy)
libc_hidden_proto(statfs)
@@ -60,5 +62,4 @@ int statfs64 (const char *file, struct statfs64 *buf)
return 0;
}
-libc_hidden_proto(statfs64)
libc_hidden_def(statfs64)
diff --git a/libc/misc/time/time.c b/libc/misc/time/time.c
index 39aacddd2..0908a8cea 100644
--- a/libc/misc/time/time.c
+++ b/libc/misc/time/time.c
@@ -153,6 +153,12 @@
#include <xlocale.h>
#endif
+libc_hidden_proto(asctime)
+libc_hidden_proto(asctime_r)
+libc_hidden_proto(ctime)
+libc_hidden_proto(localtime)
+libc_hidden_proto(localtime_r)
+
libc_hidden_proto(memset)
libc_hidden_proto(memcpy)
libc_hidden_proto(strcmp)
@@ -245,15 +251,12 @@ extern time_t _time_mktime_tzi(struct tm *timeptr, int store_on_success,
/**********************************************************************/
#ifdef L_asctime
-libc_hidden_proto(asctime_r)
-
static char __time_str[26];
char *asctime(const struct tm *ptm)
{
return asctime_r(ptm, __time_str);
}
-libc_hidden_proto(asctime)
libc_hidden_def(asctime)
#endif
@@ -396,7 +399,6 @@ char *asctime_r(register const struct tm *__restrict ptm,
return buffer - 8;
}
-libc_hidden_proto(asctime_r)
libc_hidden_def(asctime_r)
#endif
@@ -471,23 +473,16 @@ clock_t clock(void)
/**********************************************************************/
#ifdef L_ctime
-libc_hidden_proto(asctime)
-libc_hidden_proto(localtime)
-
char *ctime(const time_t *clock)
{
/* ANSI/ISO/SUSv3 say that ctime is equivalent to the following. */
return asctime(localtime(clock));
}
-libc_hidden_proto(ctime)
libc_hidden_def(ctime)
#endif
/**********************************************************************/
#ifdef L_ctime_r
-libc_hidden_proto(asctime_r)
-libc_hidden_proto(localtime_r)
-
char *ctime_r(const time_t *clock, char *buf)
{
struct tm xtm;
@@ -560,8 +555,6 @@ struct tm *gmtime_r(const time_t *__restrict timer,
/**********************************************************************/
#ifdef L_localtime
-libc_hidden_proto(localtime_r)
-
struct tm *localtime(const time_t *timer)
{
register struct tm *ptm = &__time_tm;
@@ -572,7 +565,6 @@ struct tm *localtime(const time_t *timer)
return ptm;
}
-libc_hidden_proto(localtime)
libc_hidden_def(localtime)
#endif
@@ -592,7 +584,6 @@ struct tm *localtime_r(register const time_t *__restrict timer,
return result;
}
-libc_hidden_proto(localtime_r)
libc_hidden_def(localtime_r)
#endif
@@ -785,6 +776,8 @@ time_t timegm(struct tm *timeptr)
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(strftime)
+
libc_hidden_proto(strftime_l)
size_t strftime(char *__restrict s, size_t maxsize,
@@ -793,7 +786,6 @@ size_t strftime(char *__restrict s, size_t maxsize,
{
return strftime_l(s, maxsize, format, timeptr, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strftime)
libc_hidden_def(strftime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
@@ -994,6 +986,7 @@ static int load_field(int k, const struct tm *__restrict timeptr)
#warning TODO: Check multibyte format string validity.
#endif
+libc_hidden_proto(__XL_NPP(strftime))
size_t __XL_NPP(strftime)(char *__restrict s, size_t maxsize,
const char *__restrict format,
const struct tm *__restrict timeptr __LOCALE_PARAM )
@@ -1276,7 +1269,6 @@ size_t __XL_NPP(strftime)(char *__restrict s, size_t maxsize,
}
goto LOOP;
}
-libc_hidden_proto(__XL_NPP(strftime))
libc_hidden_def(__XL_NPP(strftime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
@@ -1295,6 +1287,8 @@ libc_hidden_def(__XL_NPP(strftime))
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(strptime)
+
libc_hidden_proto(strptime_l)
char *strptime(const char *__restrict buf, const char *__restrict format,
@@ -1302,7 +1296,6 @@ char *strptime(const char *__restrict buf, const char *__restrict format,
{
return strptime_l(buf, format, tm, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(strptime)
libc_hidden_def(strptime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
@@ -1449,8 +1442,7 @@ static const unsigned char spec[] = {
#define MAX_PUSH 4
-libc_hidden_proto(localtime_r)
-
+libc_hidden_proto(__XL_NPP(strptime))
char *__XL_NPP(strptime)(const char *__restrict buf, const char *__restrict format,
struct tm *__restrict tm __LOCALE_PARAM)
{
@@ -1660,7 +1652,6 @@ char *__XL_NPP(strptime)(const char *__restrict buf, const char *__restrict form
}
return NULL;
}
-libc_hidden_proto(__XL_NPP(strptime))
libc_hidden_def(__XL_NPP(strptime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
@@ -2356,6 +2347,8 @@ time_t attribute_hidden _time_mktime_tzi(struct tm *timeptr, int store_on_succes
#if defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE)
+libc_hidden_proto(wcsftime)
+
libc_hidden_proto(wcsftime_l)
size_t wcsftime(wchar_t *__restrict s, size_t maxsize,
@@ -2364,11 +2357,11 @@ size_t wcsftime(wchar_t *__restrict s, size_t maxsize,
{
return wcsftime_l(s, maxsize, format, timeptr, __UCLIBC_CURLOCALE);
}
-libc_hidden_proto(wcsftime)
libc_hidden_def(wcsftime)
#else /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
+libc_hidden_proto(__XL_NPP(wcsftime))
size_t __XL_NPP(wcsftime)(wchar_t *__restrict s, size_t maxsize,
const wchar_t *__restrict format,
const struct tm *__restrict timeptr __LOCALE_PARAM )
@@ -2376,7 +2369,6 @@ size_t __XL_NPP(wcsftime)(wchar_t *__restrict s, size_t maxsize,
#warning wcsftime always fails
return 0; /* always fail */
}
-libc_hidden_proto(__XL_NPP(wcsftime))
libc_hidden_def(__XL_NPP(wcsftime))
#endif /* defined(__UCLIBC_HAS_XLOCALE__) && !defined(__UCLIBC_DO_XLOCALE) */
diff --git a/libc/misc/wchar/wchar.c b/libc/misc/wchar/wchar.c
index 28efbba22..62a5af704 100644
--- a/libc/misc/wchar/wchar.c
+++ b/libc/misc/wchar/wchar.c
@@ -178,6 +178,7 @@ extern size_t _wchar_wcsntoutf8s(char *__restrict s, size_t n,
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(btowc)
wint_t btowc(int c)
{
#ifdef __CTYPE_HAS_8_BIT_LOCALES
@@ -208,7 +209,6 @@ wint_t btowc(int c)
#endif /* __CTYPE_HAS_8_BIT_LOCALES */
}
-libc_hidden_proto(btowc)
libc_hidden_def(btowc)
#endif
@@ -248,11 +248,11 @@ int wctob(wint_t c)
/**********************************************************************/
#ifdef L_mbsinit
+libc_hidden_proto(mbsinit)
int mbsinit(const mbstate_t *ps)
{
return !ps || !ps->__mask;
}
-libc_hidden_proto(mbsinit)
libc_hidden_def(mbsinit)
#endif
@@ -261,13 +261,13 @@ libc_hidden_def(mbsinit)
libc_hidden_proto(mbrtowc)
+libc_hidden_proto(mbrlen)
size_t mbrlen(const char *__restrict s, size_t n, mbstate_t *__restrict ps)
{
static mbstate_t mbstate; /* Rely on bss 0-init. */
return mbrtowc(NULL, s, n, (ps != NULL) ? ps : &mbstate);
}
-libc_hidden_proto(mbrlen)
libc_hidden_def(mbrlen)
#endif
@@ -276,6 +276,7 @@ libc_hidden_def(mbrlen)
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbrtowc)
size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
size_t n, mbstate_t *__restrict ps)
{
@@ -326,7 +327,6 @@ size_t mbrtowc(wchar_t *__restrict pwc, const char *__restrict s,
}
return (size_t) r;
}
-libc_hidden_proto(mbrtowc)
libc_hidden_def(mbrtowc)
#endif
@@ -338,6 +338,7 @@ libc_hidden_proto(wcsnrtombs)
/* Note: We completely ignore ps in all currently supported conversions. */
/* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcrtomb)
size_t wcrtomb(register char *__restrict s, wchar_t wc,
mbstate_t *__restrict ps)
{
@@ -360,7 +361,6 @@ size_t wcrtomb(register char *__restrict s, wchar_t wc,
r = wcsnrtombs(s, &pwc, 1, MB_LEN_MAX, ps);
return (r != 0) ? r : 1;
}
-libc_hidden_proto(wcrtomb)
libc_hidden_def(wcrtomb)
#endif
@@ -369,6 +369,7 @@ libc_hidden_def(wcrtomb)
libc_hidden_proto(mbsnrtowcs)
+libc_hidden_proto(mbsrtowcs)
size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
@@ -377,7 +378,6 @@ size_t mbsrtowcs(wchar_t *__restrict dst, const char **__restrict src,
return mbsnrtowcs(dst, src, SIZE_MAX, len,
((ps != NULL) ? ps : &mbstate));
}
-libc_hidden_proto(mbsrtowcs)
libc_hidden_def(mbsrtowcs)
#endif
@@ -390,12 +390,12 @@ libc_hidden_def(mbsrtowcs)
libc_hidden_proto(wcsnrtombs)
+libc_hidden_proto(wcsrtombs)
size_t wcsrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t len, mbstate_t *__restrict ps)
{
return wcsnrtombs(dst, src, SIZE_MAX, len, ps);
}
-libc_hidden_proto(wcsrtombs)
libc_hidden_def(wcsrtombs)
#endif
@@ -694,6 +694,7 @@ size_t attribute_hidden _wchar_wcsntoutf8s(char *__restrict s, size_t n,
/* WARNING: We treat len as SIZE_MAX when dst is NULL! */
+libc_hidden_proto(mbsnrtowcs)
size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
size_t NMC, size_t len, mbstate_t *__restrict ps)
{
@@ -792,7 +793,6 @@ size_t mbsnrtowcs(wchar_t *__restrict dst, const char **__restrict src,
}
return len - count;
}
-libc_hidden_proto(mbsnrtowcs)
libc_hidden_def(mbsnrtowcs)
#endif
@@ -804,6 +804,7 @@ libc_hidden_def(mbsnrtowcs)
/* Note: We completely ignore ps in all currently supported conversions.
* TODO: Check for valid state anyway? */
+libc_hidden_proto(wcsnrtombs)
size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
size_t NWC, size_t len, mbstate_t *__restrict ps)
{
@@ -912,13 +913,14 @@ size_t wcsnrtombs(char *__restrict dst, const wchar_t **__restrict src,
}
return len - count;
}
-libc_hidden_proto(wcsnrtombs)
libc_hidden_def(wcsnrtombs)
#endif
/**********************************************************************/
#ifdef L_wcswidth
+libc_hidden_proto(wcswidth)
+
#ifdef __UCLIBC_MJN3_ONLY__
#warning REMINDER: If we start doing translit, wcwidth and wcswidth will need updating.
#warning TODO: Update wcwidth to match latest by Kuhn.
@@ -1155,7 +1157,6 @@ int wcswidth(const wchar_t *pwcs, size_t n)
#endif /* __UCLIBC_HAS_LOCALE__ */
-libc_hidden_proto(wcswidth)
libc_hidden_def(wcswidth)
#endif
diff --git a/libc/misc/wctype/wctype.c b/libc/misc/wctype/wctype.c
index 0be119a57..f9feb3822 100644
--- a/libc/misc/wctype/wctype.c
+++ b/libc/misc/wctype/wctype.c
@@ -185,21 +185,21 @@ enum {
#ifdef __UCLIBC_DO_XLOCALE
#define ISW_FUNC_BODY(NAME) \
+libc_hidden_proto(__PASTE3(isw,NAME,_l)); \
int __PASTE3(isw,NAME,_l) (wint_t wc, __locale_t l) \
{ \
return iswctype_l(wc, __PASTE2(_CTYPE_is,NAME), l); \
} \
-libc_hidden_proto(__PASTE3(isw,NAME,_l)); \
libc_hidden_def(__PASTE3(isw,NAME,_l))
#else /* __UCLIBC_DO_XLOCALE */
#define ISW_FUNC_BODY(NAME) \
+libc_hidden_proto(__PASTE2(isw,NAME)); \
int __PASTE2(isw,NAME) (wint_t wc) \
{ \
return iswctype(wc, __PASTE2(_CTYPE_is,NAME)); \
} \
-libc_hidden_proto(__PASTE2(isw,NAME)); \
libc_hidden_def(__PASTE2(isw,NAME))
#endif /* __UCLIBC_DO_XLOCALE */
@@ -500,6 +500,7 @@ libc_hidden_def(towupper)
static const unsigned char typestring[] = __CTYPE_TYPESTRING;
/* extern const unsigned char typestring[]; */
+libc_hidden_proto(wctype)
wctype_t wctype(const char *property)
{
const unsigned char *p;
@@ -518,7 +519,6 @@ wctype_t wctype(const char *property)
/* TODO - Add locale-specific classifications. */
return 0;
}
-libc_hidden_proto(wctype)
libc_hidden_def(wctype)
#endif
@@ -531,11 +531,11 @@ libc_hidden_def(wctype)
libc_hidden_proto(wctype)
+libc_hidden_proto(wctype_l)
wctype_t wctype_l (const char *property, __locale_t locale)
{
return wctype(property);
}
-libc_hidden_proto(wctype_l)
libc_hidden_def(wctype_l)
#endif
@@ -907,6 +907,7 @@ libc_hidden_def(towctrans)
static const char transstring[] = __CTYPE_TRANSTRING;
+libc_hidden_proto(wctrans)
wctrans_t wctrans(const char *property)
{
const unsigned char *p;
@@ -925,7 +926,6 @@ wctrans_t wctrans(const char *property)
/* TODO - Add locale-specific translations. */
return 0;
}
-libc_hidden_proto(wctrans)
libc_hidden_def(wctrans)
#endif