libm-alias-float.h 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. /* Define aliases for libm float 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_FLOAT_H
  16. #define _LIBM_ALIAS_FLOAT_H
  17. #include <bits/floatn.h>
  18. /* Define _FloatN / _FloatNx aliases for a float libm function that
  19. has internal name FROM ## f ## R and public names TO ## suffix ## R
  20. for each suffix of a supported _FloatN / _FloatNx floating-point
  21. type with the same format as float. */
  22. #if __HAVE_FLOAT32 && !__HAVE_DISTINCT_FLOAT32
  23. # define libm_alias_float_other_r(from, to, r) \
  24. weak_alias (from ## f ## r, to ## f32 ## r)
  25. #else
  26. # define libm_alias_float_other_r(from, to, r)
  27. #endif
  28. /* Likewise, but without the R suffix. */
  29. #define libm_alias_float_other(from, to) \
  30. libm_alias_float_other_r (from, to, )
  31. /* Define aliases for a float libm function that has internal name
  32. FROM ## f ## R and public names TO ## suffix ## R for each suffix
  33. of a supported floating-point type with the same format as float.
  34. This should only be used for functions where such public names
  35. exist for _FloatN types, not for implementation-namespace exported
  36. names (where there is one name per format, not per type) or for
  37. obsolescent functions not provided for _FloatN types. */
  38. #define libm_alias_float_r(from, to, r) \
  39. weak_alias (from ## f ## r, to ## f ## r); \
  40. libm_alias_float_other_r (from, to, r)
  41. /* Likewise, but without the R suffix. */
  42. #define libm_alias_float(from, to) libm_alias_float_r (from, to, )
  43. #endif