diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-07-04 16:16:50 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-07-04 16:16:50 +0200 |
commit | 04b9dc2d30cfc9b383029f6a4b02e2725108b0ae (patch) | |
tree | e117a998173b767f9fd009d49c4f8573d8b85432 /LibM | |
parent | 63814ffebf16291419745cd8ba29a4d2fd888563 (diff) | |
download | serenity-04b9dc2d30cfc9b383029f6a4b02e2725108b0ae.zip |
Libraries: Create top level directory for libraries.
Things were getting a little crowded in the project root, so this patch
moves the Lib*/ directories into Libraries/.
Diffstat (limited to 'LibM')
-rw-r--r-- | LibM/Makefile | 25 | ||||
-rwxr-xr-x | LibM/install.sh | 6 | ||||
-rw-r--r-- | LibM/math.cpp | 149 | ||||
-rw-r--r-- | LibM/math.h | 66 |
4 files changed, 0 insertions, 246 deletions
diff --git a/LibM/Makefile b/LibM/Makefile deleted file mode 100644 index 1c19cabadf..0000000000 --- a/LibM/Makefile +++ /dev/null @@ -1,25 +0,0 @@ -include ../Makefile.common - -OBJS = math.o - -LIBRARY = libm.a -DEFINES += -DUSERLAND - -all: $(LIBRARY) - -$(LIBRARY): $(OBJS) - @echo "LIB $@"; $(AR) rcs $@ $(OBJS) - -.cpp.o: - @echo "CXX $<"; $(CXX) $(CXXFLAGS) -o $@ -c $< - --include $(OBJS:%.o=%.d) - -clean: - @echo "CLEAN"; rm -f $(LIBRARY) $(OBJS) *.d - -install: $(LIBRARY) - # Copy headers - rsync -a --include '*/' --include '*.h' --exclude '*' . ../Root/usr/include - # Install the library - cp $(LIBRARY) ../Root/usr/lib diff --git a/LibM/install.sh b/LibM/install.sh deleted file mode 100755 index 83c8f6e632..0000000000 --- a/LibM/install.sh +++ /dev/null @@ -1,6 +0,0 @@ -#!/bin/bash - -mkdir -p ../Root/usr/include/sys/ -mkdir -p ../Root/usr/lib/ -cp *.h ../Root/usr/include/ -cp libm.a ../Root/usr/lib/ diff --git a/LibM/math.cpp b/LibM/math.cpp deleted file mode 100644 index 8d0cc11135..0000000000 --- a/LibM/math.cpp +++ /dev/null @@ -1,149 +0,0 @@ -#include <LibC/assert.h> -#include <LibM/math.h> - -extern "C" { -double trunc(double x) -{ - return (int)x; -} - -double cos(double angle) -{ - return sin(angle + M_PI_2); -} - -double ampsin(double angle) -{ - double looped_angle = fmod(M_PI + angle, M_TAU) - M_PI; - double looped_angle_squared = looped_angle * looped_angle; - - double quadratic_term; - if (looped_angle > 0) { - quadratic_term = -looped_angle_squared; - } else { - quadratic_term = looped_angle_squared; - } - - double linear_term = M_PI * looped_angle; - - return quadratic_term + linear_term; -} - -double sin(double angle) -{ - double vertical_scaling = M_PI_2 * M_PI_2; - return ampsin(angle) / vertical_scaling; -} - -double pow(double x, double y) -{ - (void)x; - (void)y; - ASSERT_NOT_REACHED(); -} - -double ldexp(double, int exp) -{ - (void)exp; - ASSERT_NOT_REACHED(); -} - -double tanh(double) -{ - ASSERT_NOT_REACHED(); -} - -double tan(double angle) -{ - return ampsin(angle) / ampsin(M_PI_2 + angle); -} - -double sqrt(double) -{ - ASSERT_NOT_REACHED(); -} - -double sinh(double) -{ - ASSERT_NOT_REACHED(); -} - -double log10(double) -{ - ASSERT_NOT_REACHED(); -} - -double log(double) -{ - ASSERT_NOT_REACHED(); -} - -double fmod(double index, double period) -{ - return index - trunc(index / period) * period; -} - -double exp(double) -{ - ASSERT_NOT_REACHED(); -} - -double cosh(double) -{ - ASSERT_NOT_REACHED(); -} - -double atan2(double, double) -{ - ASSERT_NOT_REACHED(); -} - -double atan(double) -{ - ASSERT_NOT_REACHED(); -} - -double asin(double) -{ - ASSERT_NOT_REACHED(); -} - -double acos(double) -{ - ASSERT_NOT_REACHED(); -} - -double fabs(double value) -{ - return value < 0 ? -value : value; -} -double log2(double) -{ - ASSERT_NOT_REACHED(); -} - -float log2f(float) -{ - ASSERT_NOT_REACHED(); -} - -long double log2l(long double) -{ - ASSERT_NOT_REACHED(); -} - -double frexp(double, int*) -{ - ASSERT_NOT_REACHED(); -} - -float frexpf(float, int*) -{ - ASSERT_NOT_REACHED(); -} - -long double frexpl(long double, int*) -{ - ASSERT_NOT_REACHED(); -} -} diff --git a/LibM/math.h b/LibM/math.h deleted file mode 100644 index 720daa7747..0000000000 --- a/LibM/math.h +++ /dev/null @@ -1,66 +0,0 @@ -#pragma once - -#include <sys/cdefs.h> - -__BEGIN_DECLS - -#define HUGE_VAL 1e10000 -#define M_PI 3.141592653589793 -#define M_PI_2 (M_PI / 2) -#define M_TAU (M_PI * 2) - -double acos(double); -float acosf(float); -double asin(double); -float asinf(float); -double atan(double); -float atanf(float); -double atan2(double, double); -float atan2f(float, float); -double cos(double); -float cosf(float); -double cosh(double); -float coshf(float); -double sin(double); -float sinf(float); -double sinh(double); -float sinhf(float); -double tan(double); -float tanf(float); -double tanh(double); -float tanhf(float); -double ceil(double); -float ceilf(float); -double floor(double); -float floorf(float); -double round(double); -float roundf(float); -double fabs(double); -float fabsf(float); -double fmod(double, double); -float fmodf(float, float); -double exp(double); -float expf(float); -double frexp(double, int* exp); -float frexpf(float, int* exp); -double log(double); -float logf(float); -double log10(double); -float log10f(float); -double sqrt(double); -float sqrtf(float); -double modf(double, double*); -float modff(float, float*); -double ldexp(double, int exp); -float ldexpf(float, int exp); - -double pow(double x, double y); - -double log2(double); -float log2f(float); -long double log2l(long double); -double frexp(double, int*); -float frexpf(float, int*); -long double frexpl(long double, int*); - -__END_DECLS |