Replace hidden_def with libm_hidden_def in math

Message ID 20180427171618.30576-1-tuliom@linux.ibm.com
State New
Headers show
Series
  • Replace hidden_def with libm_hidden_def in math
Related show

Commit Message

Tulio Magno Quites Machado Filho April 27, 2018, 5:16 p.m.
libm_hidden_def expand the parameters and do not require an extra layer
of macros.
These were the last 3 files in math/ still using hidden_def().

2018-04-27  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>

	* math/w_exp_compat.c: Replace hidden_def with libm_hidden_def..
	* math/w_expl_compat.c: Likewise.
	* math/w_exp_template.c: Likewise.  Remove hidden_def_x.

Signed-off-by: Tulio Magno Quites Machado Filho <tuliom@linux.ibm.com>
---
 math/w_exp_compat.c   | 2 +-
 math/w_exp_template.c | 5 +----
 math/w_expl_compat.c  | 3 ++-
 3 files changed, 4 insertions(+), 6 deletions(-)

Comments

Joseph Myers April 27, 2018, 7:34 p.m. | #1
On Fri, 27 Apr 2018, Tulio Magno Quites Machado Filho wrote:

> libm_hidden_def expand the parameters and do not require an extra layer
> of macros.
> These were the last 3 files in math/ still using hidden_def().
> 
> 2018-04-27  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
> 
> 	* math/w_exp_compat.c: Replace hidden_def with libm_hidden_def..
> 	* math/w_expl_compat.c: Likewise.
> 	* math/w_exp_template.c: Likewise.  Remove hidden_def_x.

OK, but without the change

> diff --git a/math/w_expl_compat.c b/math/w_expl_compat.c
> index dda930405e..4e80ce82e3 100644
> --- a/math/w_expl_compat.c
> +++ b/math/w_expl_compat.c
> @@ -22,6 +22,7 @@ static char rcsid[] = "$NetBSD: $";
>   * wrapper expl(x)
>   */
>  
> +#include <libc-symbols.h>

(libc-symbols.h is automatically included via "-include 
$(..)include/libc-symbols.h" from Makeconfig, you should never need to 
include it explicitly).
Tulio Magno Quites Machado Filho April 30, 2018, 4:13 p.m. | #2
Joseph Myers <joseph@codesourcery.com> writes:

> [ text/plain ]
> On Fri, 27 Apr 2018, Tulio Magno Quites Machado Filho wrote:
>
>> libm_hidden_def expand the parameters and do not require an extra layer
>> of macros.
>> These were the last 3 files in math/ still using hidden_def().
>> 
>> 2018-04-27  Tulio Magno Quites Machado Filho  <tuliom@linux.ibm.com>
>> 
>> 	* math/w_exp_compat.c: Replace hidden_def with libm_hidden_def..
>> 	* math/w_expl_compat.c: Likewise.
>> 	* math/w_exp_template.c: Likewise.  Remove hidden_def_x.
>
> OK, but without the change
>
>> diff --git a/math/w_expl_compat.c b/math/w_expl_compat.c
>> index dda930405e..4e80ce82e3 100644
>> --- a/math/w_expl_compat.c
>> +++ b/math/w_expl_compat.c
>> @@ -22,6 +22,7 @@ static char rcsid[] = "$NetBSD: $";
>>   * wrapper expl(x)
>>   */
>>  
>> +#include <libc-symbols.h>
>
> (libc-symbols.h is automatically included via "-include 
> $(..)include/libc-symbols.h" from Makeconfig, you should never need to 
> include it explicitly).

Fixed and pushed as dc115e1cdc36.

Thanks!

Patch

diff --git a/math/w_exp_compat.c b/math/w_exp_compat.c
index 5b0f3ad50a..ccda100075 100644
--- a/math/w_exp_compat.c
+++ b/math/w_exp_compat.c
@@ -33,6 +33,6 @@  __exp (double x)
 
   return z;
 }
-hidden_def (__exp)
+libm_hidden_def (__exp)
 libm_alias_double (__exp, exp)
 #endif
diff --git a/math/w_exp_template.c b/math/w_exp_template.c
index 49a3e8f2a1..b24e4056a6 100644
--- a/math/w_exp_template.c
+++ b/math/w_exp_template.c
@@ -26,9 +26,6 @@ 
 # include <math.h>
 # include <math_private.h>
 
-/* Provide an additional macro expansion for hidden_def.  */
-#define hidden_def_x(name) hidden_def (name)
-
 FLOAT
 M_DECL_FUNC (__exp) (FLOAT x)
 {
@@ -38,7 +35,7 @@  M_DECL_FUNC (__exp) (FLOAT x)
     __set_errno (ERANGE);
   return z;
 }
-hidden_def_x (M_SUF (__exp))
+libm_hidden_def (M_SUF (__exp))
 declare_mgen_alias (__exp, exp)
 
 #endif /* __USE_WRAPPER_TEMPLATE.  */
diff --git a/math/w_expl_compat.c b/math/w_expl_compat.c
index dda930405e..4e80ce82e3 100644
--- a/math/w_expl_compat.c
+++ b/math/w_expl_compat.c
@@ -22,6 +22,7 @@  static char rcsid[] = "$NetBSD: $";
  * wrapper expl(x)
  */
 
+#include <libc-symbols.h>
 #include <math.h>
 #include <math_private.h>
 #include <math-svid-compat.h>
@@ -41,6 +42,6 @@  long double __expl(long double x)	/* wrapper exp */
 	return z;
 # endif
 }
-hidden_def (__expl)
+libm_hidden_def (__expl)
 libm_alias_ldouble (__exp, exp)
 #endif