]> git.buserror.net Git - polintos/scott/priv.git/commitdiff
Move stdio defs to stdio.h, and fix an x86 makefile bug.
authorScott Wood <scott@thor.buserror.net>
Sun, 5 Aug 2007 18:14:02 +0000 (13:14 -0500)
committerScott Wood <scott@thor.buserror.net>
Sun, 5 Aug 2007 19:37:44 +0000 (14:37 -0500)
include/c/std/stdio.h [new file with mode: 0644]
kernel/arch/x86/Makefile
kernel/arch/x86/Makefile.final
kernel/include/kern/libc.h

diff --git a/include/c/std/stdio.h b/include/c/std/stdio.h
new file mode 100644 (file)
index 0000000..97e3d75
--- /dev/null
@@ -0,0 +1,25 @@
+#ifndef _C_STDIO_H
+#define _C_STDIO_H
+
+#include <stdint.h>
+#include <stdarg.h>
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+       size_t vsnprintf(char *buf, size_t size, const char *str, va_list args);
+
+       size_t snprintf(char *buf, size_t size, const char *str, ...)
+       __attribute__((format(printf, 3, 4)));
+
+       size_t sprintf(char *buf, const char *str, ...)
+       __attribute__((format(printf, 2, 3)));
+
+       size_t printf(const char *str, ...)
+       __attribute__((format(printf, 1, 2)));
+
+#ifdef __cplusplus
+}
+#endif
+#endif
index 02c5e8ed8ca47f5493b2db914048ff5528936977..357720c1e99d0f0c0f2cd2db3eb536b7526fdce8 100644 (file)
@@ -1,6 +1,8 @@
 DIR := arch/x86/
 DIRS += $(DIR)
 
+CXXFLAGS += -fno-omit-frame-pointer -march=i686
+
 RAW_ASFILES := entry
 RAW_CXXFILES := descriptors misc multiboot mem thread
 
index 34e87b8da2b4b05e40e2da025c0119630df299bb..090c11d9ba638bda89810275de418ad54d5340a7 100644 (file)
@@ -1,5 +1,4 @@
 DIR := arch/x86/
-CXXFLAGS += -fno-omit-frame-pointer -march=i686
 
 $(BUILDDIR)/kernel: $(OBJS) $(LIBS) $(DIR)linker-script
        @echo $(COMP): Linking kernel: $@
index 1867a6da9d9602f79e909aec21f4fb837b4b6bd1..89a166b9b066a6e7ed29c398eb709afd5adffd98 100644 (file)
@@ -3,30 +3,16 @@
 
 #include <kern/types.h>
 #include <stdarg.h>
+#include <string.h>
+#include <stdio.h>
 
 extern "C" {
-       size_t vsnprintf(char *buf, size_t size, const char *str, va_list args);
-       size_t snprintf(char *buf, size_t size, const char *str, ...)
-       __attribute__((format(printf, 3, 4)));
-       size_t sprintf(char *buf, const char *str, ...)
-       __attribute__((format(printf, 2, 3)));
-       size_t printf(const char *str, ...)
-       __attribute__((format(printf, 1, 2)));
-
        // FIXME: template/alignof versions
        void *memcpy(void *dest, const void *src, size_t len);
        void *memmove(void *dest, const void *src, size_t len);
        int memcmp(const void *b1, const void *b2, size_t len);
        void *memset(void *b, int ch, size_t len);
 
-       size_t strnlen(const char *s, size_t n);
-       size_t strlen(const char *s);
-
-       char *strcpy(char *dest, const char *src);
-       char *strncpy(char *dest, const char *src, size_t len);
-       char *strcat(char *dest, const char *src);
-       char *strncat(char *dest, const char *src, size_t len);
-
        void bzero(void *b, size_t len);
        
        void *malloc(size_t size);