From c977c7df7189c251ccfb7d0ed09178833f779809 Mon Sep 17 00:00:00 2001 From: Patrick Georgi Date: Thu, 24 Feb 2011 07:18:11 +0000 Subject: libpayload: Move stdin/stdout/stderr away from headers Otherwise they exist in several object files, confusing the linker Signed-off-by: Patrick Georgi Acked-by: Peter Stuge git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6377 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1 --- payloads/libpayload/include/curses.h | 6 +----- payloads/libpayload/include/stdio.h | 7 +------ payloads/libpayload/libc/printf.c | 7 +++++++ 3 files changed, 9 insertions(+), 11 deletions(-) diff --git a/payloads/libpayload/include/curses.h b/payloads/libpayload/include/curses.h index 6c9307a598..1859f022cb 100644 --- a/payloads/libpayload/include/curses.h +++ b/payloads/libpayload/include/curses.h @@ -148,11 +148,7 @@ typedef unsigned long chtype; typedef unsigned long mmask_t; #endif -//// #include -struct _IO_FILE { - // FIXME -}; -typedef struct _IO_FILE FILE; +#include //// #include #include /* we need va_list */ //// #define va_list int // FIXME diff --git a/payloads/libpayload/include/stdio.h b/payloads/libpayload/include/stdio.h index fb40a0dc7e..d39e9f8545 100644 --- a/payloads/libpayload/include/stdio.h +++ b/payloads/libpayload/include/stdio.h @@ -32,14 +32,9 @@ #include -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 diff --git a/payloads/libpayload/libc/printf.c b/payloads/libpayload/libc/printf.c index a1ebb14092..389d2277ea 100644 --- a/payloads/libpayload/libc/printf.c +++ b/payloads/libpayload/libc/printf.c @@ -36,6 +36,13 @@ #include #include +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. */ -- cgit v1.2.3