]> xenbits.xensource.com Git - unikraft/libs/newlib.git/commitdiff
sincosl.c: Import from musl
authorVlad-Andrei BĂDOIU (78692) <vlad_andrei.badoiu@stud.acs.upb.ro>
Wed, 8 Jan 2020 14:17:32 +0000 (14:17 +0000)
committerFelipe Huici <felipe.huici@neclab.eu>
Wed, 8 Jan 2020 14:29:28 +0000 (15:29 +0100)
Copied as is from the official musl git mirror
git://git.musl-libc.org/musl, commit 6fcb440d.

We only keep the non optimized definition since
all the long double math functions from newlib
are wrappers over double.

Signed-off-by: Vlad-Andrei Badoiu <vlad_andrei.badoiu@stud.acs.upb.ro>
Reviewed-by: Felipe Huici <felipe.huici@neclab.eu>
Makefile.uk
musl-imported/src/math/sincosl.c [new file with mode: 0644]

index 17d8d7a50e8d79c630221e9e02199072833d763f..a963e821e67a56a5cd837c5465943bf37ee7adf8 100644 (file)
@@ -132,6 +132,7 @@ LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/mntent.c
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/misc/syslog.c
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcsetattr.c
 LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/termios/tcgetattr.c
+LIBNEWLIBGLUE_SRCS-y += $(LIBNEWLIBC_BASE)/musl-imported/src/math/sincosl.c
 
 ifeq ($(CONFIG_LIBNEWLIBC_CRYPT),y)
 LIBNEWLIBGLUE_CFLAGS-y   += -Wno-missing-braces -Wno-sign-compare -Wno-char-subscripts
diff --git a/musl-imported/src/math/sincosl.c b/musl-imported/src/math/sincosl.c
new file mode 100644 (file)
index 0000000..f7586df
--- /dev/null
@@ -0,0 +1,12 @@
+#define _GNU_SOURCE
+
+#include <math.h>
+
+void sincosl(long double x, long double *sin, long double *cos)
+{
+       double sind, cosd;
+
+       sincos(x, &sind, &cosd);
+       *sin = sind;
+       *cos = cosd;
+}