diff options
author | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 20:22:10 +0000 |
---|---|---|
committer | Howard Hinnant <hhinnant@apple.com> | 2012-02-23 20:22:10 +0000 |
commit | d184e53e8a66e174b2fdaee22c1794aa3cfc18ed (patch) | |
tree | a0d5eca481f0ef55b53711a954ef11e97c823c02 /lib/Headers | |
parent | 00ff5a919be81485a5abfaf3498ebd1bc1ed8161 (diff) |
* tgmath_logb.patch implements the missing logb function (see C99 standard 7.22, paragraph 5). * tgmath_fabs_complex.patch corrects the return types for the complex fabs functions. These must be non-complex float/double/long double (see C99 standard 7.22, paragraph 4 and 7.3.8.1). Patch contributed by Kristof Beyls.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@151276 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Headers')
-rw-r--r-- | lib/Headers/tgmath.h | 23 |
1 files changed, 20 insertions, 3 deletions
diff --git a/lib/Headers/tgmath.h b/lib/Headers/tgmath.h index 1b0b9d24c1..4fa1cf72f2 100644 --- a/lib/Headers/tgmath.h +++ b/lib/Headers/tgmath.h @@ -540,15 +540,15 @@ static long double _TG_ATTRS __tg_fabs(long double __x) {return fabsl(__x);} -static float _Complex +static float _TG_ATTRS __tg_fabs(float _Complex __x) {return cabsf(__x);} -static double _Complex +static double _TG_ATTRS __tg_fabs(double _Complex __x) {return cabs(__x);} -static long double _Complex +static long double _TG_ATTRS __tg_fabs(long double _Complex __x) {return cabsl(__x);} @@ -976,6 +976,23 @@ static long double #undef log2 #define log2(__x) __tg_log2(__tg_promote1((__x))(__x)) +// logb + +static float + _TG_ATTRS + __tg_logb(float __x) {return logbf(__x);} + +static double + _TG_ATTRS + __tg_logb(double __x) {return logb(__x);} + +static long double + _TG_ATTRS + __tg_logb(long double __x) {return logbl(__x);} + +#undef logb +#define logb(__x) __tg_logb(__tg_promote1((__x))(__x)) + // lrint static long |