Add libm_alias_*_other_r macros.
[glibc.git] / sysdeps / generic / libm-alias-double.h
blob0593ad98864085b0058d273ee869e25af9e4feb5
1 /* Define aliases for libm double functions.
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 /* Define _FloatN / _FloatNx aliases for a double libm function that
23 has internal name FROM ## R and public names TO ## suffix ## R for
24 each suffix of a supported _FloatN / _FloatNx floating-point type
25 with the same format as double. */
26 #define libm_alias_double_other_r(from, to, r)
28 /* Likewise, but without the R suffix. */
29 #define libm_alias_double_other(from, to) \
30 libm_alias_double_other_r (from, to, )
32 /* Define aliases for a double libm function that has internal name
33 FROM ## R and public names TO ## suffix ## R for each suffix of a
34 supported floating-point type with the same format as double. This
35 should only be used for functions where such public names exist for
36 _FloatN types, not for implementation-namespace exported names
37 (where there is one name per format, not per type) or for
38 obsolescent functions not provided for _FloatN types. */
39 #ifdef NO_LONG_DOUBLE
40 # define libm_alias_double_r(from, to, r) \
41 weak_alias (from ## r, to ## r) \
42 strong_alias (from ## r, from ## l ## r) \
43 weak_alias (from ## r, to ## l ## r) \
44 libm_alias_double_other_r (from, to, r)
45 #else
46 # define libm_alias_double_r(from, to, r) \
47 weak_alias (from ## r, to ## r) \
48 libm_alias_double_other_r (from, to, r)
49 #endif
51 /* Likewise, but without the R suffix. */
52 #define libm_alias_double(from, to) libm_alias_double_r (from, to, )
54 #endif