blob: 7aa53f3e8e75bc8eab31ef441c674117e52811e3 [file] [log] [blame]
Elliott Hughes02c78a32014-04-11 17:02:20 -07001/*
2 * Copyright (C) 2014 The Android Open Source Project
3 * All rights reserved.
4 *
5 * Redistribution and use in source and binary forms, with or without
6 * modification, are permitted provided that the following conditions
7 * are met:
8 * * Redistributions of source code must retain the above copyright
9 * notice, this list of conditions and the following disclaimer.
10 * * Redistributions in binary form must reproduce the above copyright
11 * notice, this list of conditions and the following disclaimer in
12 * the documentation and/or other materials provided with the
13 * distribution.
14 *
15 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
16 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
17 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
18 * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE
19 * COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT,
20 * INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING,
21 * BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS
22 * OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED
23 * AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
24 * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT
25 * OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
26 * SUCH DAMAGE.
27 */
28
Elliott Hughes02c78a32014-04-11 17:02:20 -070029#include <math.h>
Elliott Hughesb0da5762016-05-02 12:44:41 -070030
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070031// Legacy cruft from before we had builtin implementations of the standard macros.
32// No longer declared in our <math.h>.
Elliott Hughes02c78a32014-04-11 17:02:20 -070033
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070034extern "C" int __fpclassifyd(double d) {
35 return fpclassify(d);
Elliott Hughes02c78a32014-04-11 17:02:20 -070036}
37__strong_alias(__fpclassify, __fpclassifyd); // glibc uses __fpclassify, BSD __fpclassifyd.
38
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070039extern "C" int __fpclassifyf(float f) {
40 return fpclassify(f);
Elliott Hughes02c78a32014-04-11 17:02:20 -070041}
42
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070043extern "C" int __isinf(double d) {
44 return isinf(d);
Elliott Hughes02c78a32014-04-11 17:02:20 -070045}
46__strong_alias(isinf, __isinf);
47
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070048extern "C" int __isinff(float f) {
49 return isinf(f);
Elliott Hughes02c78a32014-04-11 17:02:20 -070050}
51__strong_alias(isinff, __isinff);
52
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070053extern "C" int __isnan(double d) {
54 return isnan(d);
Elliott Hughes02c78a32014-04-11 17:02:20 -070055}
56__strong_alias(isnan, __isnan);
57
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070058extern "C" int __isnanf(float f) {
59 return isnan(f);
Elliott Hughes02c78a32014-04-11 17:02:20 -070060}
61__strong_alias(isnanf, __isnanf);
62
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070063extern "C" int __isfinite(double d) {
64 return isfinite(d);
Calin Juravle1abc9ff2014-04-17 18:17:32 +010065}
66__strong_alias(isfinite, __isfinite);
67
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070068extern "C" int __isfinitef(float f) {
69 return isfinite(f);
Calin Juravle1abc9ff2014-04-17 18:17:32 +010070}
71__strong_alias(isfinitef, __isfinitef);
72
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070073extern "C" int __isnormal(double d) {
74 return isnormal(d);
Calin Juravle1abc9ff2014-04-17 18:17:32 +010075}
76__strong_alias(isnormal, __isnormal);
77
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070078extern "C" int __isnormalf(float f) {
79 return isnormal(f);
Calin Juravle1abc9ff2014-04-17 18:17:32 +010080}
81__strong_alias(isnormalf, __isnormalf);
82
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070083extern "C" int __fpclassifyl(long double ld) {
84 return fpclassify(ld);
Elliott Hughes02c78a32014-04-11 17:02:20 -070085}
86
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070087extern "C" int __isinfl(long double ld) {
88 return isinf(ld);
Elliott Hughes02c78a32014-04-11 17:02:20 -070089}
90
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070091extern "C" int __isnanl(long double ld) {
92 return isnan(ld);
Elliott Hughes02c78a32014-04-11 17:02:20 -070093}
94
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070095extern "C" int __isfinitel(long double ld) {
96 return isfinite(ld);
Calin Juravle1abc9ff2014-04-17 18:17:32 +010097}
98
Elliott Hughes5c6a7bf2017-10-19 13:56:28 -070099extern "C" int __isnormall(long double ld) {
100 return isnormal(ld);
Calin Juravle1abc9ff2014-04-17 18:17:32 +0100101}
102
Elliott Hughes02c78a32014-04-11 17:02:20 -0700103__strong_alias(isinfl, __isinfl);
104__strong_alias(isnanl, __isnanl);
Calin Juravle1abc9ff2014-04-17 18:17:32 +0100105__strong_alias(isfinitel, __isfinitel);
106__strong_alias(isnormall, __isnormall);