From 224b419d1e750e3e9ced5c57774bb2bdd5292e28 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Tue, 8 Dec 2020 18:15:27 +0000 Subject: Make strtoimax, strtoumax, wcstoimax, wcstoumax into aliases The functions strtoimax, strtoumax, wcstoimax, wcstoumax currently have three implementations each (wordsize-32, wordsize-64 and dummy implementation in stdlib/ using #error), defining the functions as thin wrappers round corresponding *_internal functions. Simplify the code by changing them into aliases of functions such as strtol and wcstoull. This is more consistent with how e.g. imaxdiv is handled. Tested for x86_64 and x86. --- stdlib/Makefile | 1 - stdlib/strtoimax.c | 1 - stdlib/strtoll.c | 1 + stdlib/strtoull.c | 1 + stdlib/strtoumax.c | 1 - stdlib/wcstoimax.c | 1 - stdlib/wcstoumax.c | 1 - 7 files changed, 2 insertions(+), 5 deletions(-) delete mode 100644 stdlib/strtoimax.c delete mode 100644 stdlib/strtoumax.c delete mode 100644 stdlib/wcstoimax.c delete mode 100644 stdlib/wcstoumax.c (limited to 'stdlib') diff --git a/stdlib/Makefile b/stdlib/Makefile index f8a1660186..29b7cd7071 100644 --- a/stdlib/Makefile +++ b/stdlib/Makefile @@ -56,7 +56,6 @@ routines := \ system canonicalize \ a64l l64a \ rpmatch strfmon strfmon_l getsubopt xpg_basename fmtmsg \ - strtoimax strtoumax wcstoimax wcstoumax \ getcontext setcontext makecontext swapcontext aux = grouping groupingwc tens_in_limb diff --git a/stdlib/strtoimax.c b/stdlib/strtoimax.c deleted file mode 100644 index f1de70f320..0000000000 --- a/stdlib/strtoimax.c +++ /dev/null @@ -1 +0,0 @@ -#error "The correct implementation must be chosen based on the `intmax_t' type" diff --git a/stdlib/strtoll.c b/stdlib/strtoll.c index b156665fc7..a6b693a341 100644 --- a/stdlib/strtoll.c +++ b/stdlib/strtoll.c @@ -30,4 +30,5 @@ compat_symbol (libc, __strtoll_internal, __strtoq_internal, GLIBC_2_0); # endif weak_alias (strtoll, strtoq) +weak_alias (strtoll, strtoimax) #endif diff --git a/stdlib/strtoull.c b/stdlib/strtoull.c index b4bf9a97d9..dd57aa550c 100644 --- a/stdlib/strtoull.c +++ b/stdlib/strtoull.c @@ -30,4 +30,5 @@ compat_symbol (libc, __strtoull_internal, __strtouq_internal, GLIBC_2_0); # endif weak_alias (strtoull, strtouq) +weak_alias (strtoull, strtoumax) #endif diff --git a/stdlib/strtoumax.c b/stdlib/strtoumax.c deleted file mode 100644 index 508cb19f8c..0000000000 --- a/stdlib/strtoumax.c +++ /dev/null @@ -1 +0,0 @@ -#error "The correct implementation must be chosen based on the `uintmax_t' type" diff --git a/stdlib/wcstoimax.c b/stdlib/wcstoimax.c deleted file mode 100644 index f1de70f320..0000000000 --- a/stdlib/wcstoimax.c +++ /dev/null @@ -1 +0,0 @@ -#error "The correct implementation must be chosen based on the `intmax_t' type" diff --git a/stdlib/wcstoumax.c b/stdlib/wcstoumax.c deleted file mode 100644 index 508cb19f8c..0000000000 --- a/stdlib/wcstoumax.c +++ /dev/null @@ -1 +0,0 @@ -#error "The correct implementation must be chosen based on the `uintmax_t' type" -- cgit 1.4.1