libm compilation fixes from Darcy Gong

git-svn-id: svn://svn.code.sf.net/p/nuttx/code/trunk@5275 42af7a65-404d-4744-a932-0658087f49c3
This commit is contained in:
patacongo 2012-10-29 20:50:27 +00:00
parent 948b57f2af
commit 2da5226ac3
48 changed files with 48 additions and 48 deletions

View File

@ -44,7 +44,7 @@ CSRCS += lib_sinf.c lib_sinhf.c lib_sqrtf.c lib_tanf.c lib_tanhf.c
CSRCS += lib_acos.c lib_asin.c lib_atan.c lib_atan2.c lib_ceil.c lib_cos.c
CSRCS += lib_cosh.c lib_exp.c lib_fabs.c lib_floor.c lib_fmod.c lib_frexp.c
CRRCS += lib_ldexp.c lib_log.c lib_log10.c lib_log2.c lib_modf.c lib_pow.c
CSRCS += lib_ldexp.c lib_log.c lib_log10.c lib_log2.c lib_modf.c lib_pow.c
CSRCS += lib_sin.c lib_sinh.c lib_sqrt.c lib_tan.c lib_tanh.c
CSRCS += lib_acosl.c lib_asinl.c lib_atan2l.c lib_atanl.c lib_ceill.c lib_cosl.c

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double acos(double x)
{
return (M_PI_2 - asin(x));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double acosl(long double x)
{
return (M_PI_2 - asinl(x));

View File

@ -39,7 +39,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double asin(double x)
{
long double y, y_sin, y_cos;

View File

@ -39,7 +39,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double asinl(long double x)
{
long double y, y_sin, y_cos;

View File

@ -40,7 +40,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double atan(double x)
{
return asin(x / sqrt(x * x + 1));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double atan2(double y, double x)
{
if (y == 0.0)

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double atan2l(long double y, long double x)
{

View File

@ -40,7 +40,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double atanl(long double x)
{
return asinl(x / sqrtl(x * x + 1));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double ceil(double x)
{
modf(x, &x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double ceill(long double x)
{
modfl(x, &x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double cos(double x)
{
return sin(x + M_PI_2);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double cosh(double x)
{
x = exp(x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double coshl(long double x)
{
x = expl(x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double cosl(long double x)
{
return sinl(x + M_PI_2);

View File

@ -37,7 +37,7 @@
#include "lib_internal.h"
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
/************************************************************************
* Private Data

View File

@ -37,7 +37,7 @@
#include "lib_internal.h"
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
/************************************************************************
* Private Data

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double fabs(double x)
{
return ((x < 0) ? -x : x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double fabsl(long double x)
{
return ((x < 0) ? -x : x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double floor(double x)
{
modf(x, &x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double floorl(long double x)
{
modfl(x, &x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double fmod(double x, double div)
{
double n0;

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double fmodl(long double x, long double div)
{
long double n0;

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double frexp(double x, int *exponent)
{
*exponent = (int)ceil(log2(x));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double frexpl(long double x, int *exponent)
{
*exponent = (int)ceill(log2(x));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double ldexp(double x, int n)
{
return (x * pow(2.0, (double)n));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double ldexpl(long double x, int n)
{
return (x * powl(2.0, (long double)n));

View File

@ -77,7 +77,7 @@ static double _expi_square_tbl[11] =
* Public Functions
************************************************************************/
static double lib_expi(size_t n)
double lib_expi(size_t n)
{
size_t i;
double val;

View File

@ -39,7 +39,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double log(double x)
{
double y, y_old, ey, epsilon;

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double log10(double x)
{
return (log(x) / M_LN10);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double log10l(long double x)
{
return (logl(x) / M_LN10);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double log2(double x)
{
return (log(x) / M_LN2);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double log2l(long double x)
{
return (logl(x) / M_LN2);

View File

@ -39,7 +39,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double logl(long double x)
{
long double y, y_old, ey, epsilon;

View File

@ -36,7 +36,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double modf(double x, double *iptr)
{
if (fabs(x) >= 4503599627370496.0)

View File

@ -39,7 +39,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double modfl(long double x, long double *iptr)
{
if (fabs(x) >= 4503599627370496.0)

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double pow(double b, double e)
{
return exp(e * log(b));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double powl(long double b, long double e)
{
return expl(e * logl(b));

View File

@ -35,7 +35,7 @@
#include <sys/types.h>
#include <math.h>
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
/************************************************************************
* Private Data

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double sinh(double x)
{
x = exp(x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double sinhl(long double x)
{
x = expl(x);

View File

@ -35,7 +35,7 @@
#include <sys/types.h>
#include <math.h>
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
/************************************************************************
* Private Data

View File

@ -41,7 +41,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double sqrt(double x)
{
long double y, y1;

View File

@ -41,7 +41,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double sqrtl(long double x)
{
long double y, y1;

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double tan(double x)
{
return (sin(x) / cos(x));

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_DOUBLE
#ifdef CONFIG_HAVE_DOUBLE
double tanh(double x)
{
double x0 = exp(x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double tanhl(long double x)
{
long double x0 = exp(x);

View File

@ -38,7 +38,7 @@
* Public Functions
************************************************************************/
#if CONFIG_HAVE_LONG_DOUBLE
#ifdef CONFIG_HAVE_LONG_DOUBLE
long double tanl(long double x)
{
return (sinl(x) / cosl(x));