From 1bb22a0a0b77370499a680a1fa4c964e1a10909b Mon Sep 17 00:00:00 2001 From: Grissiom Date: Wed, 9 Jan 2013 21:37:41 +0800 Subject: [PATCH] fix math.h Declare sin/cos and M_PI in math.h. --- components/libc/minilibc/math.c | 1 - components/libc/minilibc/math.h | 9 +++++++-- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/components/libc/minilibc/math.c b/components/libc/minilibc/math.c index bcba6051a8..27315a428c 100644 --- a/components/libc/minilibc/math.c +++ b/components/libc/minilibc/math.c @@ -9,7 +9,6 @@ */ #define PRECISION 9 -#define M_PI 3.141592653589793238462643 static double cos_off_tbl[] = {0.0, -M_PI/2., 0, -M_PI/2.}; static double cos_sign_tbl[] = {1,-1,-1,1}; diff --git a/components/libc/minilibc/math.h b/components/libc/minilibc/math.h index e2ce6f8e71..b436eb08b5 100644 --- a/components/libc/minilibc/math.h +++ b/components/libc/minilibc/math.h @@ -1,4 +1,9 @@ -#ifndef __STDIO_H__ -#define __STDIO_H__ +#ifndef __MATH_H__ +#define __MATH_H__ + +#define M_PI 3.141592653589793238462643 + +double sin(double x); +double cos(double x); #endif -- GitLab