From fd4e1324fef445e4a04b615327282ecbe6a9b8fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?IOhannes=20m=20zm=C3=B6lnig?= Date: Sat, 11 Mar 2006 20:51:46 +0000 Subject: moved definitions of float-intrinsics for osX<10.3 to iemmatrix.h svn path=/trunk/externals/iem/iemmatrix/; revision=4693 --- src/iemmatrix.h | 18 +++++++++++++++++- src/mtx_pow.c | 8 -------- 2 files changed, 17 insertions(+), 9 deletions(-) diff --git a/src/iemmatrix.h b/src/iemmatrix.h index 4080707..98c9da2 100644 --- a/src/iemmatrix.h +++ b/src/iemmatrix.h @@ -41,6 +41,9 @@ # ifndef MSW # define MSW # endif +# ifndef NT +# define NT +# endif # pragma warning( disable : 4244 ) # pragma warning( disable : 4305 ) @@ -63,12 +66,25 @@ # define fabsf fabs # define sqrtf sqrt # define powf pow +#endif +#ifdef __APPLE__ +# include +# if defined (MAC_OS_X_VERSION_10_3) && MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_3 +# else +//float intrinsics not in math.h, so we define them here +# define sqrtf(v) (float)sqrt((double)(v)) +# define cosf(v) (float)cos((double)(v)) +# define sinf(v) (float)sin((double)(v)) +# define tanf(v) (float)tan((double)(v)) +# define logf(v) (float)log((double)(v)) +# define expf(v) (float)exp((double)(v)) +# define atan2f(v,p) (float)atan2((double)(v), (double)(p)) +# define powf(v,p) (float)pow((double)(v), (double)(p)) #endif typedef double t_matrixfloat; - /* the main class...*/ typedef struct _matrix { diff --git a/src/mtx_pow.c b/src/mtx_pow.c index f8b0212..639b7d0 100644 --- a/src/mtx_pow.c +++ b/src/mtx_pow.c @@ -16,14 +16,6 @@ /* mtx_.^ */ /* LATER: do a mtx_pow, mtx_^ */ -#ifdef __APPLE__ -/* there is no such thing like powf on apple... */ -static inline float powf (float v, float p) -{ - return (float) pow((double)v, (double) p); -} -#endif /* __APPLE__ */ - static t_class *mtx_powelement_class, *mtx_powscalar_class; static void mtx_powelement_matrix(t_mtx_binmtx *x, t_symbol *s, int argc, t_atom *argv) -- cgit v1.2.1