public inbox for libc-hacker@sourceware.org
 help / color / mirror / Atom feed
From: Jakub Jelinek <jakub@redhat.com>
To: Ulrich Drepper <drepper@redhat.com>
Cc: Glibc hackers <libc-hacker@sources.redhat.com>
Subject: [PATCH] Fix strtold_l/wcstold_l, plus one warning fix
Date: Mon, 15 Mar 2004 23:11:00 -0000	[thread overview]
Message-ID: <20040315210230.GT3822@sunsite.ms.mff.cuni.cz> (raw)

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

             reply	other threads:[~2004-03-15 23:11 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-03-15 23:11 Jakub Jelinek [this message]
2004-03-16  0:04 ` Ulrich Drepper

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20040315210230.GT3822@sunsite.ms.mff.cuni.cz \
    --to=jakub@redhat.com \
    --cc=drepper@redhat.com \
    --cc=libc-hacker@sources.redhat.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).