Browse Source

implement sincosf and sincosl functions; add prototypes

presumably broken gcc may generate calls to these, and it's said that
ffmpeg makes use of sincosf.
Rich Felker 13 years ago
parent
commit
5657cc58e5
3 changed files with 19 additions and 0 deletions
  1. 3 0
      include/math.h
  2. 8 0
      src/linux/sincosf.c
  3. 8 0
      src/linux/sincosl.c

+ 3 - 0
include/math.h

@@ -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

+ 8 - 0
src/linux/sincosf.c

@@ -0,0 +1,8 @@
+#define _GNU_SOURCE
+#include <math.h>
+
+void sincosf(float t, float *y, float *x)
+{
+	*y = sinf(t);
+	*x = cosf(t);
+}

+ 8 - 0
src/linux/sincosl.c

@@ -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);
+}