aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-03-11 20:51:46 +0000
committerIOhannes m zmölnig <zmoelnig@users.sourceforge.net>2006-03-11 20:51:46 +0000
commitfd4e1324fef445e4a04b615327282ecbe6a9b8fe (patch)
tree24f7529f81b9640a3ae52758717b774a1093b6a8
parent367867f3e64adcc142bb4900fea68240bcb82a06 (diff)
moved definitions of float-intrinsics for osX<10.3 to iemmatrix.h
svn path=/trunk/externals/iem/iemmatrix/; revision=4693
-rw-r--r--src/iemmatrix.h18
-rw-r--r--src/mtx_pow.c8
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 <AvailabilityMacros.h>
+# 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)