From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 129363 invoked by alias); 20 Jun 2018 02:05:01 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 129153 invoked by uid 89); 20 Jun 2018 02:05:00 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-26.1 required=5.0 tests=AWL,BAYES_00,GIT_PATCH_0,GIT_PATCH_1,GIT_PATCH_2,GIT_PATCH_3,RCVD_IN_DNSWL_LOW,SPF_PASS autolearn=ham version=3.3.2 spammy=redefined X-HELO: mx0a-001b2d01.pphosted.com From: Tulio Magno Quites Machado Filho To: libc-alpha@sourceware.org Cc: joseph@codesourcery.com Subject: [PATCH 01/12] Undefine redirections after long double definition on __LDBL_COMPAT [BZ #23294] Date: Wed, 20 Jun 2018 02:05:00 -0000 In-Reply-To: <20180620020426.20372-1-tuliom@linux.ibm.com> References: <20180620020426.20372-1-tuliom@linux.ibm.com> X-TM-AS-GCONF: 00 x-cbid: 18062002-0068-0000-0000-0000030B8D65 X-IBM-SpamModules-Scores: X-IBM-SpamModules-Versions: BY=3.00009223; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000265; SDB=6.01049503; UDB=6.00537768; IPR=6.00828476; MB=3.00021748; MTD=3.00000008; XFM=3.00000015; UTC=2018-06-20 02:04:55 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18062002-0069-0000-0000-000044BE8C22 Message-Id: <20180620020426.20372-2-tuliom@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-06-20_01:,, signatures=0 X-SW-Source: 2018-06/txt/msg00579.txt.bz2 After defining the long double redirections to double, __MATHDECL_1 has to be redefined to its previous state in order to avoid redirecting all subsequent types. 2018-06-19 Tulio Magno Quites Machado Filho [BZ #23294] * math/complex.h (__MATHDECL_1_IMPL): New macro. [__LDBL_COMPAT](__MATHDECL_1): Redefine as __MATHDECL_1_IMPL after redirection. * math/math.h (__MATHDECL_1_IMPL, __MATHREDIR): New macros. [__LDBL_COMPAT](__MATHDECL_2): Removed. [__LDBL_COMPAT](__MATHDECL_1): Redefine as __MATHDECL_1_IMPL after redirection. Signed-off-by: Tulio Magno Quites Machado Filho --- math/complex.h | 10 +++++++++- math/math.h | 18 +++++++++++++----- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/math/complex.h b/math/complex.h index 544e7acd82..40cf8e0705 100644 --- a/math/complex.h +++ b/math/complex.h @@ -98,8 +98,10 @@ __BEGIN_DECLS #define __MATHDECL(type, function, args) \ __MATHDECL_1(type, function, args); \ __MATHDECL_1(type, __CONCAT(__,function), args) -#define __MATHDECL_1(type, function, args) \ +#define __MATHDECL_1_IMPL(type, function, args) \ extern type __MATH_PRECNAME(function) args __THROW +#define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) #define _Mdouble_ double #define __MATH_PRECNAME(name) name @@ -127,6 +129,11 @@ __BEGIN_DECLS # define _Mdouble_ long double # define __MATH_PRECNAME(name) name##l # include +# if defined __LDBL_COMPAT +# undef __MATHDECL_1 +# define __MATHDECL_1(type, function, args) \ + __MATHDECL_1_IMPL(type, function, args) +# endif #endif #undef _Mdouble_ #undef __MATH_PRECNAME @@ -215,6 +222,7 @@ __BEGIN_DECLS # undef _Mdouble_complex_ #endif +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL diff --git a/math/math.h b/math/math.h index ddee4e4083..998d3042c5 100644 --- a/math/math.h +++ b/math/math.h @@ -279,8 +279,13 @@ enum #define __MATHDECLX(type, function,suffix, args, attrib) \ __MATHDECL_1(type, function,suffix, args) __attribute__ (attrib); \ __MATHDECL_1(type, __CONCAT(__,function),suffix, args) __attribute__ (attrib) -#define __MATHDECL_1(type, function,suffix, args) \ +#define __MATHDECL_1_IMPL(type, function, suffix, args) \ extern type __MATH_PRECNAME(function,suffix) args __THROW +#define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) + +#define __MATHREDIR(type, function, suffix, args, to) \ + extern type __REDIRECT_NTH (__MATH_PRECNAME (function, suffix), args, to) #define _Mdouble_ double #define __MATH_PRECNAME(name,r) __CONCAT(name,r) @@ -331,11 +336,8 @@ extern long double __REDIRECT_NTH (nexttowardl, # endif # undef __MATHDECL_1 -# define __MATHDECL_2(type, function,suffix, args, alias) \ - extern type __REDIRECT_NTH(__MATH_PRECNAME(function,suffix), \ - args, alias) # define __MATHDECL_1(type, function,suffix, args) \ - __MATHDECL_2(type, function,suffix, args, __CONCAT(function,suffix)) + __MATHREDIR(type, function, suffix, args, __CONCAT(function,suffix)) # endif /* Include the file of declarations again, this time using `long double' @@ -353,6 +355,11 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_DOUBLE # undef __MATH_DECLARING_FLOATN +# if defined __LDBL_COMPAT +# undef __MATHDECL_1 +# define __MATHDECL_1(type, function, suffix, args) \ + __MATHDECL_1_IMPL(type, function, suffix, args) +# endif # endif /* !(__NO_LONG_DOUBLE_MATH && _LIBC) || __LDBL_COMPAT */ #endif /* Use ISO C99. */ @@ -479,6 +486,7 @@ extern long double __REDIRECT_NTH (nexttowardl, # undef __MATH_DECLARING_FLOATN #endif /* __HAVE_DISTINCT_FLOAT128X || (__HAVE_FLOAT128X && !_LIBC). */ +#undef __MATHDECL_1_IMPL #undef __MATHDECL_1 #undef __MATHDECL #undef __MATHCALL -- 2.14.4