public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
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	[thread overview]
Message-ID: <20180620020426.20372-2-tuliom@linux.ibm.com> (raw)
In-Reply-To: <20180620020426.20372-1-tuliom@linux.ibm.com>

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  <tuliom@linux.ibm.com>

	[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 <tuliom@linux.ibm.com>
---
 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 <bits/cmathcalls.h>
+# 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

  parent reply	other threads:[~2018-06-20  2:05 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-06-20  2:04 [PATCHv2 00/12] Introduce ieee128 symbols and redirections Tulio Magno Quites Machado Filho
2018-06-20  2:05 ` [PATCH 05/12] Refactor math/bits/math-finite.h, reusing math/bits/mathcalls.h [BZ #23292] Tulio Magno Quites Machado Filho
2018-06-20 10:41   ` Joseph Myers
2018-06-20  2:05 ` [PATCH 02/12] Move declare_mgen_finite_alias definition Tulio Magno Quites Machado Filho
2018-06-20 10:39   ` Joseph Myers
2018-06-20 13:14     ` Tulio Magno Quites Machado Filho
2018-06-20 21:04       ` Joseph Myers
2018-06-20 21:09         ` Tulio Magno Quites Machado Filho
2018-06-20  2:05 ` [PATCH 03/12] Add a generic scalb implementation Tulio Magno Quites Machado Filho
2018-06-20 20:32   ` Joseph Myers
2018-06-20 22:19     ` Tulio Magno Quites Machado Filho
2018-06-20 22:24       ` Joseph Myers
2018-06-20  2:05 ` Tulio Magno Quites Machado Filho [this message]
2018-06-20 10:38   ` [PATCH 01/12] Undefine redirections after long double definition on __LDBL_COMPAT [BZ #23294] Joseph Myers
2018-06-20  2:05 ` [PATCH 07/12] ldbl-128ibm-compat: Provide a scalb implementation Tulio Magno Quites Machado Filho
2018-06-20 20:40   ` Joseph Myers
2018-06-20  2:05 ` [PATCH 04/12] Add a generic significand implementation Tulio Magno Quites Machado Filho
2018-06-20 20:34   ` Joseph Myers
2018-06-20 21:31     ` Tulio Magno Quites Machado Filho
2018-06-21 17:01     ` Joseph Myers
2018-06-22 21:33       ` [PATCH] m68k: Reorganize log1p and significand implementations Tulio Magno Quites Machado Filho
2018-06-22 21:34         ` Jeff Law
2018-06-22 21:54         ` Joseph Myers
2018-06-20  2:05 ` [PATCH 06/12] ldbl-128ibm-compat: Create libm-alias-float128.h Tulio Magno Quites Machado Filho
2018-06-20 20:39   ` Joseph Myers
2018-06-20 22:03     ` Tulio Magno Quites Machado Filho
2018-06-20  2:06 ` [PATCH 09/12] ldbl-128ibm-compat: Provide nexttoward functions Tulio Magno Quites Machado Filho
2018-06-20 20:46   ` Joseph Myers
2018-06-21  1:08     ` Tulio Magno Quites Machado Filho
2018-06-21 16:25       ` Joseph Myers
2018-06-20  2:06 ` [PATCH 10/12] ldbl-128ibm-compat: Redirect long double functions to f128/ieee128 functions Tulio Magno Quites Machado Filho
2018-06-20 20:54   ` Joseph Myers
2018-06-20 22:48     ` Tulio Magno Quites Machado Filho
2018-06-20  2:06 ` [PATCH 12/12] ldbl-128ibm-compat: Provide ieee128 symbols to narrow functions Tulio Magno Quites Machado Filho
2018-06-20 10:55   ` Joseph Myers
2018-06-20  2:06 ` [PATCH 08/12] ldbl-128ibm-compat: Provide a significand implementation Tulio Magno Quites Machado Filho
2018-06-20 20:40   ` Joseph Myers
2018-06-20  2:06 ` [PATCH 11/12] ldbl-128ibm-compat: Redirect complex math functions Tulio Magno Quites Machado Filho
2018-06-20 21:00   ` Joseph Myers
2018-06-21 19:05     ` Tulio Magno Quites Machado Filho
2018-06-21 16:53 ` [PATCHv2 00/12] Introduce ieee128 symbols and redirections Joseph Myers

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=20180620020426.20372-2-tuliom@linux.ibm.com \
    --to=tuliom@linux.ibm.com \
    --cc=joseph@codesourcery.com \
    --cc=libc-alpha@sourceware.org \
    /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).