Usermode/libm - Stubbed up a quick libm (using gcc builtins)
authorJohn Hodge <[email protected]>
Sat, 8 Jun 2013 09:37:33 +0000 (17:37 +0800)
committerJohn Hodge <[email protected]>
Sat, 8 Jun 2013 09:37:33 +0000 (17:37 +0800)
Usermode/Libraries/libm.so_src/Makefile [new file with mode: 0644]
Usermode/Libraries/libm.so_src/include_exp/math.h [new file with mode: 0644]
Usermode/Libraries/libm.so_src/pow.c [new file with mode: 0644]
Usermode/Libraries/libm.so_src/stub.c [new file with mode: 0644]

diff --git a/Usermode/Libraries/libm.so_src/Makefile b/Usermode/Libraries/libm.so_src/Makefile
new file mode 100644 (file)
index 0000000..1c6df33
--- /dev/null
@@ -0,0 +1,17 @@
+#
+# Acess2 C Library (Math)
+# - By John Hodge (thePowersGang)
+#
+
+-include ../Makefile.cfg
+
+CPPFLAGS += 
+CFLAGS   += -Werror -Wextra
+ASFLAGS  +=
+LDFLAGS  += 
+
+OBJ  = stub.o pow.o
+BIN := libm.so
+
+include ../Makefile.tpl
+
diff --git a/Usermode/Libraries/libm.so_src/include_exp/math.h b/Usermode/Libraries/libm.so_src/include_exp/math.h
new file mode 100644 (file)
index 0000000..349547e
--- /dev/null
@@ -0,0 +1,13 @@
+/*
+ * Acess2 C Library (Maths)
+ * - By John Hodge (thePowersGang)
+ *
+ * math.h
+ * - C99 Header
+ */
+#ifndef _LIBM__MATH_H_
+#define _LIBM__MATH_H_
+
+extern double  pow(double x, double y);
+
+#endif
diff --git a/Usermode/Libraries/libm.so_src/pow.c b/Usermode/Libraries/libm.so_src/pow.c
new file mode 100644 (file)
index 0000000..f35d7c2
--- /dev/null
@@ -0,0 +1,18 @@
+/*
+ * Acess2 C Library (Maths)
+ * - By John Hodge (thePowersGang)
+ *
+ * pow.c
+ * - pow(), powf() and powl()
+ */
+#include <math.h>
+
+// === CODE ===
+double pow(double x, double y)
+{
+       if( x == 1.0f )
+               return 1.0f;
+       if( y == 0.0f )
+               return 1.0f;
+       return __builtin_pow(x,y);
+}
diff --git a/Usermode/Libraries/libm.so_src/stub.c b/Usermode/Libraries/libm.so_src/stub.c
new file mode 100644 (file)
index 0000000..1c6c52a
--- /dev/null
@@ -0,0 +1,14 @@
+/*
+ * Acess2 C Library (Maths)
+ * - By John Hodge (thePowersGang)
+ *
+ * stub.c
+ * - Provides SoMain (unused)
+ */
+
+// === CODE ===
+int SoMain(void)
+{
+       return 0;
+}
+

UCC git Repository :: git.ucc.asn.au