* [PATCH] Fix strtold_l/wcstold_l, plus one warning fix
@ 2004-03-15 23:11 Jakub Jelinek
2004-03-16 0:04 ` Ulrich Drepper
0 siblings, 1 reply; 2+ messages in thread
From: Jakub Jelinek @ 2004-03-15 23:11 UTC (permalink / raw)
To: Ulrich Drepper; +Cc: Glibc hackers
Hi!
Recent *{str,wcs}told* changes broke arches where double == long double.
Fixed thusly, plus one warning fix.
2004-03-16 Jakub Jelinek <jakub@redhat.com>
* sysdeps/generic/strtold_l.c (STRING_TYPE, STRTOLD, __STRTOLD,
__STRTOD, INTERNAL, INTERNAL1): Define, use them.
[! USE_WIDE_CHAR] (INTERNAL (__STRTOLD)): Add libc_hidden_def.
* inet/getnameinfo.c: Include stdlib.h.
--- libc/sysdeps/generic/strtold_l.c 14 Mar 2004 20:56:09 -0000 1.1
+++ libc/sysdeps/generic/strtold_l.c 15 Mar 2004 22:35:41 -0000
@@ -20,21 +20,39 @@
#include <stdlib.h>
#include <xlocale.h>
+#ifdef USE_WIDE_CHAR
+# define STRING_TYPE wchar_t
+# define STRTOLD wcstold_l
+# define __STRTOLD __wcstold_l
+# define __STRTOD __wcstod_l
+#else
+# define STRING_TYPE char
+# define STRTOLD strtold_l
+# define __STRTOLD __strtold_l
+# define __STRTOD __strtod_l
+#endif
-extern double ____strtod_l_internal (const char *, char **, int, __locale_t);
+#define INTERNAL(x) INTERNAL1(x)
+#define INTERNAL1(x) __##x##_internal
+extern double INTERNAL (__STRTOD) (const STRING_TYPE *, STRING_TYPE **,
+ int, __locale_t);
/* There is no `long double' type, use the `double' implementations. */
long double
-____strtold_l_internal (const char *nptr, char **endptr, int group,
- __locale_t loc)
+INTERNAL (__STRTOLD) (const STRING_TYPE *nptr, STRING_TYPE **endptr,
+ int group, __locale_t loc)
{
- return ____strtod_l_internal (nptr, endptr, group, loc);
+ return INTERNAL (__STRTOD) (nptr, endptr, group, loc);
}
-
+#ifndef USE_WIDE_CHAR
+libc_hidden_def (INTERNAL (__STRTOLD))
+#endif
long double
-strtold (const char *nptr, char **endptr, __locale_t loc)
+weak_function
+__STRTOLD (const STRING_TYPE *nptr, STRING_TYPE **endptr, __locale_t loc)
{
- return ____strtod_l_internal (nptr, endptr, 0, loc);
+ return INTERNAL (__STRTOD) (nptr, endptr, 0, loc);
}
+weak_alias (__STRTOLD, STRTOLD)
--- libc/inet/getnameinfo.c 13 Mar 2004 08:46:13 -0000 1.31
+++ libc/inet/getnameinfo.c 15 Mar 2004 23:01:01 -0000
@@ -38,6 +38,7 @@ SOFTWARE, EVEN IF ADVISED OF THE POSSIBI
#include <alloca.h>
#include <errno.h>
#include <netdb.h>
+#include <stdlib.h>
#include <stdio.h>
#include <string.h>
#include <unistd.h>
Jakub
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] Fix strtold_l/wcstold_l, plus one warning fix
2004-03-15 23:11 [PATCH] Fix strtold_l/wcstold_l, plus one warning fix Jakub Jelinek
@ 2004-03-16 0:04 ` Ulrich Drepper
0 siblings, 0 replies; 2+ messages in thread
From: Ulrich Drepper @ 2004-03-16 0:04 UTC (permalink / raw)
To: Jakub Jelinek; +Cc: Glibc hackers
Applied.
--
⧠Ulrich Drepper ⧠Red Hat, Inc. ⧠444 Castro St ⧠Mountain View, CA â
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2004-03-16 0:04 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2004-03-15 23:11 [PATCH] Fix strtold_l/wcstold_l, plus one warning fix Jakub Jelinek
2004-03-16 0:04 ` Ulrich Drepper
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).