From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 7517 invoked by alias); 23 Apr 2009 21:56:47 -0000 Received: (qmail 7500 invoked by uid 22791); 23 Apr 2009 21:56:47 -0000 X-SWARE-Spam-Status: No, hits=-2.3 required=5.0 tests=AWL,BAYES_00 X-Spam-Check-By: sourceware.org Received: from sunsite.ms.mff.cuni.cz (HELO sunsite.mff.cuni.cz) (195.113.15.26) by sourceware.org (qpsmtpd/0.43rc1) with ESMTP; Thu, 23 Apr 2009 21:56:42 +0000 Received: from sunsite.mff.cuni.cz (localhost.localdomain [127.0.0.1]) by sunsite.mff.cuni.cz (8.13.8/8.13.8) with ESMTP id n3NM6pgk001270; Fri, 24 Apr 2009 00:06:51 +0200 Received: (from jakub@localhost) by sunsite.mff.cuni.cz (8.13.8/8.13.8/Submit) id n3NM6oD1001269; Fri, 24 Apr 2009 00:06:50 +0200 Date: Thu, 23 Apr 2009 21:56:00 -0000 From: Jakub Jelinek To: Ulrich Drepper Cc: Glibc hackers , "Joseph S. Myers" Subject: [PATCH] Provide long double redirects in and even for __NO_LONG_DOUBLE_MATH Message-ID: <20090423220650.GX16681@sunsite.ms.mff.cuni.cz> Reply-To: Jakub Jelinek Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.4.2.2i Mailing-List: contact libc-hacker-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-hacker-owner@sourceware.org X-SW-Source: 2009-04/txt/msg00004.txt.bz2 Hi! As discussed in http://gcc.gnu.org/PR39491, as at least ISO C99 requires long double functions, glibc should provide redirects for __NO_LONG_DOUBLE_MATH case for them. Currently they are provided only if the target arch switched to larger long double, yet code is compiled with -mlong-double-64 (say powerpc*, sparc*, alpha, s390*), but not on arm or hppa. Joseph tested an earlier version of this patch on arm, but I've noticed the earlier patch was wrong when compiling glibc itself (in that case I think the long double prototypes shouldn't be present so that they all can be safely aliased to the double versions), so this patch is untested. 2009-04-23 Jakub Jelinek * math/math.h: Provide *l long double prototypes redirecting to double functions even when __NO_LONG_DOUBLE_MATH and not __LDBL_COMPAT. * math/complex.h: Likewise. --- libc/math/math.h.jj 2006-02-03 20:15:48.000000000 +0100 +++ libc/math/math.h 2009-04-23 23:45:04.000000000 +0200 @@ -98,7 +98,9 @@ __BEGIN_DECLS # undef __MATH_PRECNAME # if (__STDC__ - 0 || __GNUC__ - 0) \ - && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT) + && (!defined __NO_LONG_DOUBLE_MATH \ + || defined __LDBL_COMPAT \ + || !defined _LIBC) # ifdef __LDBL_COMPAT # ifdef __USE_ISOC99 @@ -115,9 +117,9 @@ extern long double __REDIRECT_NTH (nextt nextafter) __attribute__ ((__const__)); # endif # endif +# endif -/* Include the file of declarations again, this time using `long double' - instead of `double' and appending l to each function name. */ +# if defined __LDBL_COMPAT || defined __NO_LONG_DOUBLE_MATH # undef __MATHDECL_1 # define __MATHDECL_2(type, function,suffix, args, alias) \ @@ -127,6 +129,8 @@ extern long double __REDIRECT_NTH (nextt __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) # endif +/* Include the file of declarations again, this time using `long double' + instead of `double' and appending l to each function name. */ # ifndef _Mlong_double_ # define _Mlong_double_ long double # endif @@ -140,8 +144,8 @@ extern long double __REDIRECT_NTH (nextt # define _Mdouble_END_NAMESPACE __END_NAMESPACE_C99 # include # undef _Mdouble_ -# undef _Mdouble_BEGIN_NAMESPACE -# undef _Mdouble_END_NAMESPACE +# undef _Mdouble_BEGIN_NAMESPACE +# undef _Mdouble_END_NAMESPACE # undef __MATH_PRECNAME # endif /* __STDC__ || __GNUC__ */ --- libc/math/complex.h.jj 2006-05-15 16:41:04.000000000 +0200 +++ libc/math/complex.h 2009-04-23 23:46:28.000000000 +0200 @@ -85,8 +85,10 @@ __BEGIN_DECLS /* And the long double versions. It is non-critical to define them here unconditionally since `long double' is required in ISO C99. */ #if (__STDC__ - 0 || __GNUC__ - 0) \ - && (!defined __NO_LONG_DOUBLE_MATH || defined __LDBL_COMPAT) -# ifdef __LDBL_COMPAT + && (!defined __NO_LONG_DOUBLE_MATH \ + || defined __LDBL_COMPAT \ + || !defined _LIBC) +# if defined __LDBL_COMPAT || defined __NO_LONG_DOUBLE_MATH # undef __MATHDECL_1 # define __MATHDECL_1(type, function, args) \ extern type __REDIRECT_NTH(__MATH_PRECNAME(function), args, function) Jakub