diff packages/language/c/libc/stdio/current/src/common/stderr.cxx @ 134:d2f49caf9e38 ecos-sw-2000-11-03

Merge from eCos master repository on 2000-11-03-09:00:49-GMT
author jlarmour
date Fri, 03 Nov 2000 21:17:40 +0000
parents 6ed91473a1cd
children e0c0827131d1
line wrap: on
line diff
--- a/packages/language/c/libc/stdio/current/src/common/stderr.cxx
+++ b/packages/language/c/libc/stdio/current/src/common/stderr.cxx
@@ -64,12 +64,18 @@
 #include <cyg/libc/stdio/stdiofiles.hxx>  // C library files
 #include <cyg/libc/stdio/stdiosupp.hxx>   // Cyg_libc_stdio_find_filename()
 
+// CONSTANTS
+
+// add 2 to the priority to allow it to be the fd 2 if necessary
+#define PRIO (CYG_INIT_LIBC+2)
+
 // STATICS
 
 Cyg_StdioStream
-cyg_libc_stdio_stderr CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_LIBC) = Cyg_StdioStream( 
+cyg_libc_stdio_stderr CYGBLD_ATTRIB_INIT_PRI(PRIO) = Cyg_StdioStream(
     Cyg_libc_stdio_find_filename(CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE,
-                                 Cyg_StdioStream::CYG_STREAM_WRITE, false, false),
+                                 Cyg_StdioStream::CYG_STREAM_WRITE,
+                                 false, false),
     Cyg_StdioStream::CYG_STREAM_WRITE, false, false, _IONBF, 0, NULL );
 
 // CLASSES
@@ -86,6 +92,10 @@ public:
 
 // And here's an instance of the class just to make the code run
 static cyg_libc_dummy_stderr_init_class cyg_libc_dummy_stderr_init
-                                         CYGBLD_ATTRIB_INIT_PRI(CYG_INIT_LIBC);
+                                             CYGBLD_ATTRIB_INIT_PRI(PRIO);
+
+// and finally stderr itself
+__externC Cyg_StdioStream * const stderr;
+Cyg_StdioStream * const stderr=&cyg_libc_stdio_stderr;
 
 // EOF stderr.cxx