diff options
author | Zheng Da <zhengda1936@gmail.com> | 2010-01-01 14:54:28 +0100 |
---|---|---|
committer | Zheng Da <zhengda1936@gmail.com> | 2010-01-01 14:54:28 +0100 |
commit | 7460caca37c30536b7b507d141cf5b7c51697cf3 (patch) | |
tree | ddb73febf35fb5f5f36e4237a02b9b6b18be7925 /libddekit | |
parent | 0ea79b053d4a853d7bdd3363ccb6c132b2f7ee5c (diff) |
Remove c_headers.h
Diffstat (limited to 'libddekit')
-rw-r--r-- | libddekit/Makefile | 2 | ||||
-rw-r--r-- | libddekit/c_headers.h | 7 | ||||
-rw-r--r-- | libddekit/include/ddekit/panic.h | 19 | ||||
-rw-r--r-- | libddekit/include/ddekit/printf.h | 2 | ||||
-rw-r--r-- | libddekit/memory.c | 2 | ||||
-rw-r--r-- | libddekit/timer.c | 1 |
6 files changed, 7 insertions, 26 deletions
diff --git a/libddekit/Makefile b/libddekit/Makefile index 018d67c9..4d5d58fa 100644 --- a/libddekit/Makefile +++ b/libddekit/Makefile @@ -20,7 +20,7 @@ makemode := library libname = libddekit SRCS= condvar.c init.c interrupt.c lock.c malloc.c memory.c \ - pci.c pgtab.c printf.c resources.c list.c \ + pci.c pgtab.c printf.c resources.c list.c panic.c \ thread.c timer.c kmem.c LCLHDRS = include/ddekit/condvar.h include/ddekit/lock.h \ include/ddekit/semaphore.h include/ddekit/debug.h \ diff --git a/libddekit/c_headers.h b/libddekit/c_headers.h deleted file mode 100644 index 6141e900..00000000 --- a/libddekit/c_headers.h +++ /dev/null @@ -1,7 +0,0 @@ -#ifndef __C_HEADERS_H__ -#define __C_HEADERS_H__ - -#include <stdio.h> -#include <stdarg.h> - -#endif diff --git a/libddekit/include/ddekit/panic.h b/libddekit/include/ddekit/panic.h index f036ab3e..1468675f 100644 --- a/libddekit/include/ddekit/panic.h +++ b/libddekit/include/ddekit/panic.h @@ -3,29 +3,14 @@ /** \defgroup DDEKit_util */ -#include "c_headers.h" - /** Panic - print error message and enter the kernel debugger. * \ingroup DDEKit_util */ -#define ddekit_panic(format, ...) do \ -{ \ - char buf[1024]; \ - snprintf (buf, 1024, "%s", format); \ - fprintf (stderr , buf, ## __VA_ARGS__); \ - fflush (stderr); \ - abort (); \ -} while (0) +void ddekit_panic(char *fmt, ...) __attribute__((noreturn)); /** Print a debug message. * \ingroup DDEKit_util */ -#define ddekit_debug(format, ...) do \ -{ \ - char buf[1024]; \ - snprintf (buf, 1024, "%s: %s\n", __func__, format); \ - fprintf (stderr , buf, ## __VA_ARGS__); \ - fflush (stderr); \ -} while (0) +void ddekit_debug(char *fmt, ...); #endif diff --git a/libddekit/include/ddekit/printf.h b/libddekit/include/ddekit/printf.h index aa086c71..35b0dfa1 100644 --- a/libddekit/include/ddekit/printf.h +++ b/libddekit/include/ddekit/printf.h @@ -1,7 +1,7 @@ #ifndef _ddekit_print_h #define _ddekit_print_h -#include "c_headers.h" +#include <stdarg.h> /** Print message. * \ingroup DDEKit_util diff --git a/libddekit/memory.c b/libddekit/memory.c index 781a4bae..69088c2a 100644 --- a/libddekit/memory.c +++ b/libddekit/memory.c @@ -10,6 +10,8 @@ * FIXME check thread-safety and add locks where appropriate */ +#include <stdlib.h> + #include "ddekit/memory.h" #include "ddekit/panic.h" diff --git a/libddekit/timer.c b/libddekit/timer.c index 4944be69..ea66e5f5 100644 --- a/libddekit/timer.c +++ b/libddekit/timer.c @@ -1,6 +1,7 @@ #include <error.h> #include <maptime.h> #include <cthreads.h> +#include <stdio.h> #include "ddekit/lock.h" #include "ddekit/memory.h" |