summaryrefslogtreecommitdiff
path: root/libc/stdlib/stdlib.c
diff options
context:
space:
mode:
authorCarmelo Amoroso <carmelo.amoroso@st.com>2011-04-06 15:13:59 +0200
committerCarmelo Amoroso <carmelo.amoroso@st.com>2011-04-06 15:13:59 +0200
commit3b3285b1b7c02d36c74a6ae265fdb02ca991c96b (patch)
tree0f3bf060794323ff690f6f4a86dc903c4570f540 /libc/stdlib/stdlib.c
parent289d19f45d7f8af9a4079938a3426aafdd2674ba (diff)
parent85f4b028d767fc390a7b866d2f58d58be489242d (diff)
Merge remote-tracking branch 'origin/master' into prelink
* origin/master: (137 commits) utils/ldd: Check for returned pointer from strrchr not the value it holds cris: add provide arch-specific vfork implementation lutimes.c, stubs.c: fix compiling lutimes, if __NR_utimensat is not defined bump version to 0.9.32-rc3-git release 0.9.32-rc3 memalign: include sys/param.h for MAX arm/bits/atomic.h: Include common/bit/atomic.h for thumb1 wctype.h: fix libc_hidden_proto for iswupper and add it for iswspace add libc_hidden_proto for wcs[n]casecmp_l really fix missing __libc_drand48_data Revert "missing prototype of __libc_drand48_data fixed" missing prototype of __libc_drand48_data fixed time.c, time.h: remove unused hidden strftime/strptime nanosleep.c: remove duplicated libc_hidden_proto ctype.c, ctype.h: remove commented parts that were banned for removal after 0.9.31 _wctype.c, wctype.h: remove unused isw* and wctype_l hidden functions time.c, wchar.h: remove unused hidden wcsftime str[n]casecmp.c: fix hidden usage remove unused hidden functions frv/memset.S: add missing libc_hidden_def ... Conflicts: ldso/ldso/ldso.c Signed-off-by: Carmelo Amoroso <carmelo.amoroso@st.com>
Diffstat (limited to 'libc/stdlib/stdlib.c')
-rw-r--r--libc/stdlib/stdlib.c28
1 files changed, 6 insertions, 22 deletions
diff --git a/libc/stdlib/stdlib.c b/libc/stdlib/stdlib.c
index 4d608eeac..cd9a0cac6 100644
--- a/libc/stdlib/stdlib.c
+++ b/libc/stdlib/stdlib.c
@@ -286,11 +286,11 @@ long atol(const char *nptr)
{
return strtol(nptr, (char **) NULL, 10);
}
-libc_hidden_def(atol)
#if UINT_MAX == ULONG_MAX
#undef atoi
extern __typeof(atol) atoi;
+/* the one in stdlib.h is not enough due to prototype mismatch */
libc_hidden_proto(atoi)
strong_alias(atol,atoi)
libc_hidden_def(atoi)
@@ -339,10 +339,13 @@ strong_alias(strtol,strtoimax)
#undef strtoll
#endif
extern __typeof(__XL_NPP(strtol)) __XL_NPP(strtoll);
+/* the one in stdlib.h is not enough due to prototype mismatch */
+#ifdef L_strtol
libc_hidden_proto(__XL_NPP(strtoll))
+#endif
strong_alias(__XL_NPP(strtol),__XL_NPP(strtoll))
+#ifdef L_strtol
libc_hidden_def(__XL_NPP(strtoll))
-#if !defined(L_strtol_l)
strong_alias(strtol,strtoq)
#endif
#endif
@@ -353,16 +356,14 @@ strong_alias(strtol,strtoq)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
-libc_hidden_proto(__XL_NPP(strtoll))
long long __XL_NPP(strtoll)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM)
{
return (long long) __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 1 __LOCALE_ARG);
}
+#ifdef L_strtoll
libc_hidden_def(__XL_NPP(strtoll))
-
-#if !defined(L_strtoll_l)
#if (ULLONG_MAX == UINTMAX_MAX)
strong_alias(strtoll,strtoimax)
#endif
@@ -375,7 +376,6 @@ strong_alias(strtoll,strtoq)
/**********************************************************************/
#if defined(L_strtoul) || defined(L_strtoul_l)
-libc_hidden_proto(__XL_NPP(strtoul))
unsigned long __XL_NPP(strtoul)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM)
@@ -395,9 +395,7 @@ strong_alias(strtoul,strtoumax)
#undef strtoull
#endif
extern __typeof(__XL_NPP(strtoul)) __XL_NPP(strtoull);
-libc_hidden_proto(__XL_NPP(strtoull))
strong_alias(__XL_NPP(strtoul),__XL_NPP(strtoull))
-libc_hidden_def(__XL_NPP(strtoull))
#if !defined(L_strtoul_l)
strong_alias(strtoul,strtouq)
#endif
@@ -410,14 +408,12 @@ strong_alias(strtoul,strtouq)
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
-libc_hidden_proto(__XL_NPP(strtoull))
unsigned long long __XL_NPP(strtoull)(const char * __restrict str,
char ** __restrict endptr, int base
__LOCALE_PARAM)
{
return __XL_NPP(_stdlib_strto_ll)(str, endptr, base, 0 __LOCALE_ARG);
}
-libc_hidden_def(__XL_NPP(strtoull))
#if !defined(L_strtoull_l)
#if (ULLONG_MAX == UINTMAX_MAX)
@@ -1047,13 +1043,11 @@ size_t wcstombs(char * __restrict s, const wchar_t * __restrict pwcs, size_t n)
/**********************************************************************/
#if defined(L_wcstol) || defined(L_wcstol_l)
-libc_hidden_proto(__XL_NPP(wcstol))
long __XL_NPP(wcstol)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base __LOCALE_PARAM)
{
return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 1 __LOCALE_ARG);
}
-libc_hidden_def(__XL_NPP(wcstol))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstol_l)
strong_alias(wcstol,wcstoimax)
@@ -1066,9 +1060,7 @@ strong_alias(wcstol,wcstoimax)
#undef wcstoll
#endif
extern __typeof(__XL_NPP(wcstol)) __XL_NPP(wcstoll);
-libc_hidden_proto(__XL_NPP(wcstoll))
strong_alias(__XL_NPP(wcstol),__XL_NPP(wcstoll))
-libc_hidden_def(__XL_NPP(wcstoll))
#endif
#endif
@@ -1077,14 +1069,12 @@ libc_hidden_def(__XL_NPP(wcstoll))
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
-libc_hidden_proto(__XL_NPP(wcstoll))
long long __XL_NPP(wcstoll)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM)
{
return (long long) __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 1 __LOCALE_ARG);
}
-libc_hidden_def(__XL_NPP(wcstoll))
#if !defined(L_wcstoll_l)
#if (ULLONG_MAX == UINTMAX_MAX)
@@ -1099,14 +1089,12 @@ strong_alias(wcstoll,wcstoq)
/**********************************************************************/
#if defined(L_wcstoul) || defined(L_wcstoul_l)
-libc_hidden_proto(__XL_NPP(wcstoul))
unsigned long __XL_NPP(wcstoul)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM)
{
return __XL_NPP(_stdlib_wcsto_l)(str, endptr, base, 0 __LOCALE_ARG);
}
-libc_hidden_def(__XL_NPP(wcstoul))
#if (ULONG_MAX == UINTMAX_MAX) && !defined(L_wcstoul_l)
strong_alias(wcstoul,wcstoumax)
@@ -1119,9 +1107,7 @@ strong_alias(wcstoul,wcstoumax)
#undef wcstoull
#endif
extern __typeof(__XL_NPP(wcstoul)) __XL_NPP(wcstoull);
-libc_hidden_proto(__XL_NPP(wcstoull))
strong_alias(__XL_NPP(wcstoul),__XL_NPP(wcstoull))
-libc_hidden_def(__XL_NPP(wcstoull))
#endif
#endif
@@ -1130,14 +1116,12 @@ libc_hidden_def(__XL_NPP(wcstoull))
#if defined(ULLONG_MAX) && (LLONG_MAX > LONG_MAX)
-libc_hidden_proto(__XL_NPP(wcstoull))
unsigned long long __XL_NPP(wcstoull)(const wchar_t * __restrict str,
wchar_t ** __restrict endptr, int base
__LOCALE_PARAM)
{
return __XL_NPP(_stdlib_wcsto_ll)(str, endptr, base, 0 __LOCALE_ARG);
}
-libc_hidden_def(__XL_NPP(wcstoull))
#if !defined(L_wcstoull_l)
#if (ULLONG_MAX == UINTMAX_MAX)