From 0908a38adc6e479d4c52713b09417769282e2db0 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Wed, 28 Jun 2017 16:43:50 +0000 Subject: Use clog10 not __clog10 in tgmath.h log10 macro. As a GNU extension, for _GNU_SOURCE glibc's complex.h provides a clog10 function and tgmath.h supports complex arguments to the log10 macro. However, tgmath.h uses __clog10 not clog10 in defining the macro. There is no namespace reason (ignoring the block-scope namespace issues that would apply equally to *every* function called by tgmath.h macros) for using __clog10 here, since this is only for _GNU_SOURCE so clog10 is always visible when this macro definition is used. Furthermore, __clog10f128 is not exported, so supporting _Float128 in tgmath.h implies using clog10 not __clog10 there. (__clog10 and clog10 aren't used in libstdc++ either, although that library would have a good case for using the __clog10 reserved-namespace export: the standard C++ library includes log10 of a complex number.) This patch duly changes the header to use clog10, and enables tests of the macro for complex arguments. Tested for x86_64. * math/tgmath.h [__USE_GNU] (log10): Use clog10 not __clog10. * math/gen-tgmath-tests.py (Tests.add_all_tests): Test log10 for complex arguments. --- ChangeLog | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'ChangeLog') diff --git a/ChangeLog b/ChangeLog index 1d11b9c..a6fbb36 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,9 @@ 2017-06-28 Joseph Myers + * math/tgmath.h [__USE_GNU] (log10): Use clog10 not __clog10. + * math/gen-tgmath-tests.py (Tests.add_all_tests): Test log10 for + complex arguments. + [BZ #21687] * math/tgmath.h (__TGMATH_BINARY_REAL_RET_ONLY): New macro. (totalorder): Use it. -- cgit v1.1