libpayload: Move stdin/stdout/stderr away from headers
authorPatrick Georgi <patrick.georgi@secunet.com>
Thu, 24 Feb 2011 07:18:11 +0000 (07:18 +0000)
committerPatrick Georgi <patrick.georgi@coresystems.de>
Thu, 24 Feb 2011 07:18:11 +0000 (07:18 +0000)
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>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@6377 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

payloads/libpayload/include/curses.h
payloads/libpayload/include/stdio.h
payloads/libpayload/libc/printf.c

index 6c9307a5986cb94fd489550b2e70883b53e02db1..1859f022cb1f597ea93561c910d3e5c23e6f05df 100644 (file)
@@ -148,11 +148,7 @@ typedef unsigned long chtype;
 typedef unsigned long mmask_t;
 #endif
 
 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
 //// #include <ncursesw/unctrl.h>
 #include <stdarg.h>    /* we need va_list */
 //// #define va_list int       // FIXME
index fb40a0dc7e2e48c3dca55b3b2cc2f991a363d498..d39e9f85451f038ebe3d12c8c5e5593e677321f3 100644 (file)
 
 #include <stddef.h>
 
 
 #include <stddef.h>
 
-struct _FILE {
-} _stdout, _stdin, _stderr;
-
 typedef struct _FILE FILE;
 
 typedef struct _FILE FILE;
 
-FILE *stdout = &_stdout;
-FILE *stdin = &_stdin;
-FILE *stderr = &_stderr;
+extern FILE *stdout, *stdin, *stderr;
 
 /**
  * @defgroup printf Print functions
 
 /**
  * @defgroup printf Print functions
index a1ebb140923224102a9c16d363fbfdda66e112d9..389d2277eaf6d22faa34f57d7bb4a40d9bd4ebc0 100644 (file)
 #include <libpayload.h>
 #include <ctype.h>
 
 #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. */
 /** Structure for specifying output methods for different printf clones. */
 struct printf_spec {
        /* Output function, returns count of printed characters or EOF. */