From patchwork Tue Feb 15 14:46:48 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: [2/3] libpayload: Move stdin/stdout/stderr away from headers Date: Tue, 15 Feb 2011 14:46:48 -0000 From: Patrick Georgi X-Patchwork-Id: 2673 Message-Id: <1297942045.3976.39.camel@linux-0a8x.site> To: coreboot@coreboot.org Otherwise they exist in several object files, confusing the linker Signed-off-by: Patrick Georgi --- payloads/libpayload/include/stdio.h | 4 +--- payloads/libpayload/libc/printf.c | 4 ++++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/payloads/libpayload/include/stdio.h b/payloads/libpayload/include/stdio.h index fb40a0d..b82f380 100644 --- a/payloads/libpayload/include/stdio.h +++ b/payloads/libpayload/include/stdio.h @@ -37,9 +37,7 @@ struct _FILE { 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 a1ebb14..5a84ee2 100644 --- a/payloads/libpayload/libc/printf.c +++ b/payloads/libpayload/libc/printf.c @@ -36,6 +36,10 @@ #include #include +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. */