0004-Fix-the-C-version-of-issignaling-when-__NO_LONG_DOUB.patch 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. From 9dbd8386a1b706beb30291a7e76bbfe69c2620cf Mon Sep 17 00:00:00 2001
  2. From: "Gabriel F. T. Gomes" <gftg@linux.vnet.ibm.com>
  3. Date: Wed, 23 Aug 2017 10:16:54 -0300
  4. Subject: [PATCH] Fix the C++ version of issignaling when __NO_LONG_DOUBLE_MATH
  5. is defined
  6. When __NO_LONG_DOUBLE_MATH is defined, __issignalingl is not available,
  7. thus issignaling with long double argument should call __issignaling,
  8. instead.
  9. Tested for powerpc64le.
  10. * math/math.h [defined __cplusplus] (issignaling): In the long
  11. double case, call __issignalingl only if __NO_LONG_DOUBLE_MATH
  12. is not defined. Call __issignaling, otherwise.
  13. (cherry picked from commit 3d7b66f66cb223e899a7ebc0f4c20f13e711c9e0)
  14. [Romain rebase on glibc 2.26]
  15. Signed-off-by: Romain Naour <romain.naour@gmail.com>
  16. ---
  17. math/math.h | 10 +++++++++-
  18. 1 file changed, 9 insertions(+), 1 deletion(-)
  19. diff --git a/math/math.h b/math/math.h
  20. index add86af..60dfa31 100644
  21. --- a/math/math.h
  22. +++ b/math/math.h
  23. @@ -486,7 +486,15 @@ enum
  24. extern "C++" {
  25. inline int issignaling (float __val) { return __issignalingf (__val); }
  26. inline int issignaling (double __val) { return __issignaling (__val); }
  27. -inline int issignaling (long double __val) { return __issignalingl (__val); }
  28. +inline int
  29. +issignaling (long double __val)
  30. +{
  31. +# ifdef __NO_LONG_DOUBLE_MATH
  32. + return __issignaling (__val);
  33. +# else
  34. + return __issignalingl (__val);
  35. +# endif
  36. +}
  37. # if __HAVE_DISTINCT_FLOAT128
  38. inline int issignaling (_Float128 __val) { return __issignalingf128 (__val); }
  39. # endif
  40. --
  41. 2.9.5