implement sincosf and sincosl functions; add prototypes
authorRich Felker <dalias@aerifal.cx>
Thu, 15 Mar 2012 06:38:42 +0000 (02:38 -0400)
committerRich Felker <dalias@aerifal.cx>
Thu, 15 Mar 2012 06:38:42 +0000 (02:38 -0400)
presumably broken gcc may generate calls to these, and it's said that
ffmpeg makes use of sincosf.

include/math.h
src/linux/sincosf.c [new file with mode: 0644]
src/linux/sincosl.c [new file with mode: 0644]

index f320b8e..e987151 100644 (file)
@@ -382,6 +382,9 @@ long double ynl(int, long double);
 double      scalb(double, double);
 float       scalbf(float, float);
 long double scalbl(long double, long double);
+void sincosf(float, float *, float *);
+void sincos(double, double *, double *);
+void sincosl(long double, long double *, long double *);
 #endif
 
 #ifdef __cplusplus
diff --git a/src/linux/sincosf.c b/src/linux/sincosf.c
new file mode 100644 (file)
index 0000000..5d8d445
--- /dev/null
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <math.h>
+
+void sincosf(float t, float *y, float *x)
+{
+       *y = sinf(t);
+       *x = cosf(t);
+}
diff --git a/src/linux/sincosl.c b/src/linux/sincosl.c
new file mode 100644 (file)
index 0000000..2bfc486
--- /dev/null
@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <math.h>
+
+void sincosl(long double t, long double *y, long double *x)
+{
+       *y = sinl(t);
+       *x = cosl(t);
+}