Home | History | Annotate | Download | only in bionic
      1 /*
      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 
     29 #include <math.h>
     30 
     31 // Legacy cruft from before we had builtin implementations of the standard macros.
     32 // No longer declared in our <math.h>.
     33 
     34 extern "C" int __fpclassifyd(double d) {
     35   return fpclassify(d);
     36 }
     37 __strong_alias(__fpclassify, __fpclassifyd); // glibc uses __fpclassify, BSD __fpclassifyd.
     38 
     39 extern "C" int __fpclassifyf(float f) {
     40   return fpclassify(f);
     41 }
     42 
     43 extern "C" int __isinf(double d) {
     44   return isinf(d);
     45 }
     46 __strong_alias(isinf, __isinf);
     47 
     48 extern "C" int __isinff(float f) {
     49   return isinf(f);
     50 }
     51 __strong_alias(isinff, __isinff);
     52 
     53 extern "C" int __isnan(double d) {
     54   return isnan(d);
     55 }
     56 __strong_alias(isnan, __isnan);
     57 
     58 extern "C" int __isnanf(float f) {
     59   return isnan(f);
     60 }
     61 __strong_alias(isnanf, __isnanf);
     62 
     63 extern "C" int __isfinite(double d) {
     64   return isfinite(d);
     65 }
     66 __strong_alias(isfinite, __isfinite);
     67 
     68 extern "C" int __isfinitef(float f) {
     69   return isfinite(f);
     70 }
     71 __strong_alias(isfinitef, __isfinitef);
     72 
     73 extern "C" int __isnormal(double d) {
     74   return isnormal(d);
     75 }
     76 __strong_alias(isnormal, __isnormal);
     77 
     78 extern "C" int __isnormalf(float f) {
     79   return isnormal(f);
     80 }
     81 __strong_alias(isnormalf, __isnormalf);
     82 
     83 extern "C" int __fpclassifyl(long double ld) {
     84   return fpclassify(ld);
     85 }
     86 
     87 extern "C" int __isinfl(long double ld) {
     88   return isinf(ld);
     89 }
     90 
     91 extern "C" int __isnanl(long double ld) {
     92   return isnan(ld);
     93 }
     94 
     95 extern "C" int __isfinitel(long double ld) {
     96   return isfinite(ld);
     97 }
     98 
     99 extern "C" int __isnormall(long double ld) {
    100   return isnormal(ld);
    101 }
    102 
    103 __strong_alias(isinfl, __isinfl);
    104 __strong_alias(isnanl, __isnanl);
    105 __strong_alias(isfinitel, __isfinitel);
    106 __strong_alias(isnormall, __isnormall);
    107