Add libm_alias_*_other_r macros.
[glibc.git] / sysdeps / ieee754 / ldbl-opt / libm-alias-double.h
blob4c22ffbcd6c8a3ac0d4381b59b65c39ffca1fa46
1 /* Define aliases for libm double functions. ldbl-opt version.
2 Copyright (C) 2017 Free Software Foundation, Inc.
3 This file is part of the GNU C Library.
5 The GNU C Library is free software; you can redistribute it and/or
6 modify it under the terms of the GNU Lesser General Public
7 License as published by the Free Software Foundation; either
8 version 2.1 of the License, or (at your option) any later version.
10 The GNU C Library is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 Lesser General Public License for more details.
15 You should have received a copy of the GNU Lesser General Public
16 License along with the GNU C Library; if not, see
17 <http://www.gnu.org/licenses/>. */
19 #ifndef _LIBM_ALIAS_DOUBLE_H
20 #define _LIBM_ALIAS_DOUBLE_H
22 #include <math_ldbl_opt.h>
23 #include <first-versions.h>
24 #include <ldbl-compat-choose.h>
26 /* Define _FloatN / _FloatNx aliases for a double libm function that
27 has internal name FROM ## R and public names TO ## suffix ## R for
28 each suffix of a supported _FloatN / _FloatNx floating-point type
29 with the same format as double. */
30 #define libm_alias_double_other_r(from, to, r)
32 /* Likewise, but without the R suffix. */
33 #define libm_alias_double_other(from, to) \
34 libm_alias_double_other_r (from, to, )
36 /* Define aliases for a double libm function that has internal name
37 FROM ## R and public names TO ## suffix ## R for each suffix of a
38 supported floating-point type with the same format as double. This
39 should only be used for functions where such public names exist for
40 _FloatN types, not for implementation-namespace exported names
41 (where there is one name per format, not per type) or for
42 obsolescent functions not provided for _FloatN types. */
43 #define libm_alias_double_r(from, to, r) \
44 weak_alias (from ## r, to ## r) \
45 LONG_DOUBLE_COMPAT_CHOOSE_libm_ ## to ## l ## r \
46 (compat_symbol (libm, \
47 from ## r, \
48 to ## l ## r, \
49 FIRST_VERSION_libm_ ## to ## l ## r), ); \
50 libm_alias_double_other_r (from, to, r)
52 /* Likewise, but without the R suffix. */
53 #define libm_alias_double(from, to) libm_alias_double_r (from, to, )
55 #endif