summaryrefslogtreecommitdiff
path: root/src/libc
diff options
context:
space:
mode:
authorAndreas Baumann <mail@andreasbaumann.cc>2017-07-14 15:13:02 +0200
committerAndreas Baumann <mail@andreasbaumann.cc>2017-07-14 15:13:02 +0200
commitf31f7960bd260cb90ffdd766393d51bd85a547d1 (patch)
tree6a9404909186c22c6bc989624b2488830e50e64e /src/libc
parent36bc53591247bbd16e42bbf7d5d4744a5416dfa8 (diff)
downloadabaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.gz
abaos-f31f7960bd260cb90ffdd766393d51bd85a547d1.tar.bz2
removed stddef.h and limits.h (come with the compiler header files)
added a stub stdint.h (only sometimes comes with the compiler) added a guide on cross compiling adapted to cross compilation, for now tcc works
Diffstat (limited to 'src/libc')
-rw-r--r--src/libc/limits.h7
-rw-r--r--src/libc/setjmp.h2
-rw-r--r--src/libc/stddef.h10
-rw-r--r--src/libc/stdint.h15
-rw-r--r--src/libc/stdio.c2
-rw-r--r--src/libc/stdio.h2
-rw-r--r--src/libc/stdlib.c2
-rw-r--r--src/libc/stdlib.h2
-rw-r--r--src/libc/string.h2
9 files changed, 21 insertions, 23 deletions
diff --git a/src/libc/limits.h b/src/libc/limits.h
deleted file mode 100644
index 1fc4e37..0000000
--- a/src/libc/limits.h
+++ /dev/null
@@ -1,7 +0,0 @@
-#ifndef LIMITS_H
-#define LIMITS_H
-
-#define INT_MAX 2147483647
-#define INT_MIN -2147483648
-
-#endif // LIMITS_H
diff --git a/src/libc/setjmp.h b/src/libc/setjmp.h
index 5f987f1..4322124 100644
--- a/src/libc/setjmp.h
+++ b/src/libc/setjmp.h
@@ -1,7 +1,7 @@
#ifndef SETJMP_H
#define SETJMP_H
-#include <stdint.h>
+#include "stdint.h"
// C99 states this should be an array so we can address it without
// the & operator, see prototypes of setjmp and longjmp
diff --git a/src/libc/stddef.h b/src/libc/stddef.h
deleted file mode 100644
index 4333661..0000000
--- a/src/libc/stddef.h
+++ /dev/null
@@ -1,10 +0,0 @@
-#ifndef STDDEF_H
-#define STDDEF_H
-
-#include <stdint.h>
-
-#define NULL ( (void *)0 )
-
-typedef uint32_t size_t;
-
-#endif /* STDDEF_H */
diff --git a/src/libc/stdint.h b/src/libc/stdint.h
new file mode 100644
index 0000000..e0f35b6
--- /dev/null
+++ b/src/libc/stdint.h
@@ -0,0 +1,15 @@
+#ifndef STDINT_H
+#define STDINT_H
+
+#if defined( __PCC__ ) || defined( __TINYC__ )
+// TODO: no stdint.h in pcc-libs/pcc or tcc, mock one, but this one is
+// most likely very incorrect
+typedef unsigned int uint32_t;
+typedef signed int int32_t;
+typedef unsigned short uint16_t;
+typedef signed short int16_t;
+typedef unsigned char uint8_t;
+typedef signed char int8_t;
+#endif
+
+#endif // STDINT_H
diff --git a/src/libc/stdio.c b/src/libc/stdio.c
index 631cfbb..87b70ef 100644
--- a/src/libc/stdio.c
+++ b/src/libc/stdio.c
@@ -1,5 +1,5 @@
#include "stdio.h"
-#include "stddef.h"
+#include <stddef.h>
#include "stdlib.h"
#include "string.h"
diff --git a/src/libc/stdio.h b/src/libc/stdio.h
index 33d7946..58c80b1 100644
--- a/src/libc/stdio.h
+++ b/src/libc/stdio.h
@@ -3,7 +3,7 @@
#include <stdarg.h>
-#include "stddef.h"
+#include <stddef.h>
#ifdef OS_ABAOS
#include "console.h"
diff --git a/src/libc/stdlib.c b/src/libc/stdlib.c
index 07eabd4..4fea56e 100644
--- a/src/libc/stdlib.c
+++ b/src/libc/stdlib.c
@@ -1,7 +1,7 @@
#include <stdbool.h>
#include "string.h"
#include "stdlib.h"
-#include "stddef.h"
+#include <stddef.h>
#include "kernel.h"
diff --git a/src/libc/stdlib.h b/src/libc/stdlib.h
index 5b2521f..f7cfc8c 100644
--- a/src/libc/stdlib.h
+++ b/src/libc/stdlib.h
@@ -1,7 +1,7 @@
#ifndef STDLIB_H
#define STDLIB_H
-#include "stddef.h"
+#include <stddef.h>
#include "memorymanagement.h"
diff --git a/src/libc/string.h b/src/libc/string.h
index 6c0fa01..f078d48 100644
--- a/src/libc/string.h
+++ b/src/libc/string.h
@@ -1,7 +1,7 @@
#ifndef STRING_H
#define STRING_H
-#include "stddef.h"
+#include <stddef.h>
void *memset( void *s, int c, size_t n );
void *memmove( void *d, const void *s, size_t n );