This is the mail archive of the libc-alpha@sourceware.org mailing list for the glibc project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

[PATCH] Move M_DECL_FUNC_R* to math-type-macros.h


Thread-safe math functions (*_r) have a different naming scheme that
doesn't fit the M_SUF() / M_DECL_FUNC() mechanism.
Move the M_DECL_FUNC_R() implementation from w_lgamma_r_template.c to
math-type-macros.h in order to reuse these macros in other functions.

2018-05-11  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* math/w_lgamma_r_template.c (M_DECL_FUNC_R_X, M_DECL_FUNC_R_S,
	M_DECL_FUNC_R): Moved to...
	* sysdeps/generic/math-type-macros.h (M_DECL_FUNC_R_X, M_DECL_FUNC_R_S,
	M_DECL_FUNC_R): ... here.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 math/w_lgamma_r_template.c         |  8 --------
 sysdeps/generic/math-type-macros.h | 12 ++++++++++++
 2 files changed, 12 insertions(+), 8 deletions(-)

diff --git a/math/w_lgamma_r_template.c b/math/w_lgamma_r_template.c
index ca54e42b61..880ff8065e 100644
--- a/math/w_lgamma_r_template.c
+++ b/math/w_lgamma_r_template.c
@@ -26,14 +26,6 @@
 # include <math.h>
 # include <math_private.h>
 
-#define M_DECL_FUNC_R_X(x) x ## _r
-#define M_DECL_FUNC_R_S(x) M_DECL_FUNC_R_X (x)
-#define M_DECL_FUNC_R(x) M_DECL_FUNC_R_S (M_SUF (x))
-
-#define M_CALL_FUNC_R_X(x) x ## _r
-#define M_CALL_FUNC_R_S(x) M_CALL_FUNC_R_X (x)
-#define M_CALL_FUNC_R(x) M_CALL_FUNC_R_S (M_SUF (x))
-
 FLOAT
 M_DECL_FUNC_R (__lgamma) (FLOAT x, int *signgamp)
 {
diff --git a/sysdeps/generic/math-type-macros.h b/sysdeps/generic/math-type-macros.h
index c86ac3361e..2e3f227b4f 100644
--- a/sysdeps/generic/math-type-macros.h
+++ b/sysdeps/generic/math-type-macros.h
@@ -124,4 +124,16 @@
 # define M_DECL_FUNC(f) M_SUF (f)
 #endif
 
+#ifndef M_DECL_FUNC_R
+# define M_DECL_FUNC_R_X(x) x ## _r
+# define M_DECL_FUNC_R_S(x) M_DECL_FUNC_R_X (x)
+# define M_DECL_FUNC_R(x) M_DECL_FUNC_R_S (M_SUF (x))
+#endif
+
+#ifndef M_CALL_FUNC_R
+# define M_CALL_FUNC_R_X(x) x ## _r
+# define M_CALL_FUNC_R_S(x) M_CALL_FUNC_R_X (x)
+# define M_CALL_FUNC_R(x) M_CALL_FUNC_R_S (M_SUF (x))
+#endif
+
 #endif /* _MATH_TYPE_MACROS */
-- 
2.14.3


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]