Author: oxygene Date: Thu Feb 24 08:18:11 2011 New Revision: 6377 URL: https://tracker.coreboot.org/trac/coreboot/changeset/6377
Log: libpayload: Move stdin/stdout/stderr away from headers
Otherwise they exist in several object files, confusing the linker
Signed-off-by: Patrick Georgi patrick.georgi@secunet.com Acked-by: Peter Stuge peter@stuge.se
Modified: trunk/payloads/libpayload/include/curses.h trunk/payloads/libpayload/include/stdio.h trunk/payloads/libpayload/libc/printf.c
Modified: trunk/payloads/libpayload/include/curses.h ============================================================================== --- trunk/payloads/libpayload/include/curses.h Thu Feb 24 06:00:33 2011 (r6376) +++ trunk/payloads/libpayload/include/curses.h Thu Feb 24 08:18:11 2011 (r6377) @@ -148,11 +148,7 @@ typedef unsigned long mmask_t; #endif
-//// #include <stdio.h> -struct _IO_FILE { - // FIXME -}; -typedef struct _IO_FILE FILE; +#include <stdio.h> //// #include <ncursesw/unctrl.h> #include <stdarg.h> /* we need va_list */ //// #define va_list int // FIXME
Modified: trunk/payloads/libpayload/include/stdio.h ============================================================================== --- trunk/payloads/libpayload/include/stdio.h Thu Feb 24 06:00:33 2011 (r6376) +++ trunk/payloads/libpayload/include/stdio.h Thu Feb 24 08:18:11 2011 (r6377) @@ -32,14 +32,9 @@
#include <stddef.h>
-struct _FILE { -} _stdout, _stdin, _stderr; - typedef struct _FILE FILE;
-FILE *stdout = &_stdout; -FILE *stdin = &_stdin; -FILE *stderr = &_stderr; +extern FILE *stdout, *stdin, *stderr;
/** * @defgroup printf Print functions
Modified: trunk/payloads/libpayload/libc/printf.c ============================================================================== --- trunk/payloads/libpayload/libc/printf.c Thu Feb 24 06:00:33 2011 (r6376) +++ trunk/payloads/libpayload/libc/printf.c Thu Feb 24 08:18:11 2011 (r6377) @@ -36,6 +36,13 @@ #include <libpayload.h> #include <ctype.h>
+static struct _FILE { +} _stdout, _stdin, _stderr; + +FILE *stdout = &_stdout; +FILE *stdin = &_stdin; +FILE *stderr = &_stderr; + /** Structure for specifying output methods for different printf clones. */ struct printf_spec { /* Output function, returns count of printed characters or EOF. */