From: nsz Date: Mon, 5 Mar 2012 01:34:10 +0000 (+0100) Subject: tgmath: fix fabs X-Git-Url: http://nsz.repo.hu/git/?p=libm;a=commitdiff_plain;h=da2f1654bc418e800e8dce3e2caf80d36692e0b5 tgmath: fix fabs --- diff --git a/include/tgmath.h b/include/tgmath.h index 169601a..75f8aa6 100644 --- a/include/tgmath.h +++ b/include/tgmath.h @@ -40,6 +40,13 @@ double complex: c ## __fun, \ long double complex: c ## __fun ## l, \ default: __fun) +#define __tg_real_complex_fabs(x) _Generic(x, \ + float: fabsf, \ + long double: fabsl, \ + float complex: cabsf, \ + double complex: cabs, \ + long double complex: cabsl, \ + default: fabs) #define acos(x) __tg_real_complex(acos, (x))(x) #define acosh(x) __tg_real_complex(acosh, (x))(x) @@ -63,7 +70,7 @@ #define exp(x) __tg_real_complex(exp, (x))(x) #define exp2(x) __tg_real(exp2, (x))(x) #define expm1(x) __tg_real(expm1, (x))(x) -#define fabs(x) __tg_real_complex(fabs, (x))(x) +#define fabs(x) __tg_real_complex_fabs(x)(x) #define fdim(x) __tg_real(fdim, (x))(x) #define floor(x) __tg_real(floor, (x))(x) #define fma(x,y,z) __tg_real_3(fma, (x), (y), (z))((x), (y), (z))