libm-alias-ldouble.h 2.6 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. /* Define aliases for libm long double functions.
  2. Copyright (C) 2017-2019 Free Software Foundation, Inc.
  3. This file is part of the GNU C Library.
  4. The GNU C Library is free software; you can redistribute it and/or
  5. modify it under the terms of the GNU Lesser General Public
  6. License as published by the Free Software Foundation; either
  7. version 2.1 of the License, or (at your option) any later version.
  8. The GNU C Library is distributed in the hope that it will be useful,
  9. but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
  11. Lesser General Public License for more details.
  12. You should have received a copy of the GNU Lesser General Public
  13. License along with the GNU C Library; if not, see
  14. <http://www.gnu.org/licenses/>. */
  15. #ifndef _LIBM_ALIAS_LDOUBLE_H
  16. #define _LIBM_ALIAS_LDOUBLE_H
  17. #include <bits/floatn.h>
  18. #if __HAVE_FLOAT128 && !__HAVE_DISTINCT_FLOAT128
  19. # define libm_alias_ldouble_other_r_f128(from, to, r) \
  20. weak_alias (from ## l ## r, to ## f128 ## r)
  21. #else
  22. # define libm_alias_ldouble_other_r_f128(from, to, r)
  23. #endif
  24. #if __HAVE_FLOAT64X_LONG_DOUBLE
  25. # define libm_alias_ldouble_other_r_f64x(from, to, r) \
  26. weak_alias (from ## l ## r, to ## f64x ## r)
  27. #else
  28. # define libm_alias_ldouble_other_r_f64x(from, to, r)
  29. #endif
  30. /* Define _FloatN / _FloatNx aliases for a long double libm function
  31. that has internal name FROM ## l ## R and public names TO ## suffix
  32. ## R for each suffix of a supported _FloatN / _FloatNx
  33. floating-point type with the same format as long double. */
  34. #define libm_alias_ldouble_other_r(from, to, r) \
  35. libm_alias_ldouble_other_r_f128 (from, to, r); \
  36. libm_alias_ldouble_other_r_f64x (from, to, r)
  37. /* Likewise, but without the R suffix. */
  38. #define libm_alias_ldouble_other(from, to) \
  39. libm_alias_ldouble_other_r (from, to, )
  40. /* Define aliases for a long double libm function that has internal
  41. name FROM ## l ## R and public names TO ## suffix ## R for each
  42. suffix of a supported floating-point type with the same format as
  43. long double. This should only be used for functions where such
  44. public names exist for _FloatN types, not for
  45. implementation-namespace exported names (where there is one name
  46. per format, not per type) or for obsolescent functions not provided
  47. for _FloatN types. */
  48. #define libm_alias_ldouble_r(from, to, r) \
  49. weak_alias (from ## l ## r, to ## l ## r); \
  50. libm_alias_ldouble_other_r (from, to, r)
  51. /* Likewise, but without the R suffix. */
  52. #define libm_alias_ldouble(from, to) libm_alias_ldouble_r (from, to, )
  53. #endif