This is the mail archive of the
ecos-patches@sources.redhat.com
mailing list for the eCos project.
Minor improvement of last stdio open change
- From: Jonathan Larmour <jlarmour at jifvik dot org>
- To: ecos-patches at ecos dot sourceware dot org
- Date: Mon, 27 Sep 2004 12:32:39 +0100
- Subject: Minor improvement of last stdio open change
Index: ChangeLog
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/ChangeLog,v
retrieving revision 1.31
diff -u -5 -p -r1.31 ChangeLog
--- ChangeLog 27 Sep 2004 11:27:08 -0000 1.31
+++ ChangeLog 27 Sep 2004 11:32:38 -0000
@@ -1,9 +1,15 @@
2004-09-27 Jonathan Larmour <jifl@eCosCentric.com>
* cdl/stdio.cdl (CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS): New option,
to control whether or not fdopen()/fileno() are implemented.
+ Only build fopen/fclose if CYGPKG_LIBC_STDIO_OPEN.
+
+ * src/common/fclose.cxx: Can remove ifdef CYGPKG_LIBC_STDIO_OPEN since
+ file now isn't even built if not.
+ * src/common/fopen.cxx: Ditto. Also condition on
+ CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS so decision is centralised in CDL.
2004-08-18 Jonathan Larmour <jifl@eCosCentric.com>
* cdl/stdio.cdl (CYGDAT_LIBC_STDIO_DEFAULT_CONSOLE): Only use
CYGDAT_IO_SERIAL_TTY_CONSOLE if set.
Index: cdl/stdio.cdl
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/cdl/stdio.cdl,v
retrieving revision 1.14
diff -u -5 -p -r1.14 stdio.cdl
--- cdl/stdio.cdl 27 Sep 2004 11:27:08 -0000 1.14
+++ cdl/stdio.cdl 27 Sep 2004 11:32:38 -0000
@@ -96,12 +96,11 @@ cdl_package CYGPKG_LIBC_STDIO {
requires CYGINT_ISO_STRING_MEMFUNCS
# The following is for scanf only. We could express this better,
# particularly since scanf is also dependent on the optional ungetc.
requires CYGINT_ISO_STDLIB_STRCONV
- compile common/fclose.cxx common/feof.cxx \
- common/fflush.cxx common/fopen.cxx \
+ compile common/fflush.cxx common/feof.cxx \
common/freopen.cxx common/setvbuf.cxx \
common/snprintf.cxx common/sprintf.cxx \
common/sscanf.cxx common/stderr.cxx \
common/stdin.cxx common/stdiofiles.cxx \
common/fseek.cxx common/stdioinlines.cxx\
@@ -276,10 +275,11 @@ cdl_package CYGPKG_LIBC_STDIO {
cdl_component CYGPKG_LIBC_STDIO_OPEN {
display "Dynamic opening/closing of files"
requires CYGINT_ISO_MALLOC
default_value { 0 != CYGINT_ISO_MALLOC }
+ compile common/fopen.cxx common/fclose.cxx
description "
fopen() and fclose() use dynamic memory
allocation routines to allocate memory for
new FILE structure pointers. If a malloc
implementation is available, this option
Index: src/common/fclose.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/src/common/fclose.cxx,v
retrieving revision 1.5
diff -u -5 -p -r1.5 fclose.cxx
--- src/common/fclose.cxx 15 Mar 2004 15:21:44 -0000 1.5
+++ src/common/fclose.cxx 27 Sep 2004 11:32:39 -0000
@@ -54,13 +54,10 @@
// CONFIGURATION
#include <pkgconf/libc_stdio.h> // Configuration header
#include <pkgconf/infra.h>
-// We can't have fclose() without fopen()
-#if defined(CYGPKG_LIBC_STDIO_OPEN)
-
// INCLUDES
#include <cyg/infra/cyg_type.h> // Common project-wide type definitions
#include <stddef.h> // NULL and size_t from compiler
#include <errno.h> // Error codes
@@ -129,8 +126,6 @@ fclose( FILE *stream ) __THROW
return 0;
} // fclose()
-#endif // if defined(CYGPKG_LIBC_STDIO_OPEN)
-
// EOF fclose.cxx
Index: src/common/fopen.cxx
===================================================================
RCS file: /cvs/ecos/ecos/packages/language/c/libc/stdio/current/src/common/fopen.cxx,v
retrieving revision 1.7
diff -u -5 -p -r1.7 fopen.cxx
--- src/common/fopen.cxx 29 Mar 2004 11:24:38 -0000 1.7
+++ src/common/fopen.cxx 27 Sep 2004 11:32:39 -0000
@@ -54,13 +54,10 @@
// CONFIGURATION
#include <pkgconf/libc_stdio.h> // Configuration header
-// Do we want fopen()?
-#if defined(CYGPKG_LIBC_STDIO_OPEN)
-
// INCLUDES
#include <cyg/infra/cyg_type.h> // Common project-wide type definitions
#include <stddef.h> // NULL and size_t from compiler
#include <errno.h> // Error codes
@@ -232,13 +229,11 @@ fopen( const char *filename, const char
return fopen_inner( dev, open_mode, binary, append );
} // fopen()
-#endif // defined(CYGPKG_LIBC_STDIO_OPEN)
-
-#ifdef CYGPKG_LIBC_STDIO_FILEIO
+#ifdef CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS
externC int fileno( FILE *stream ) __THROW
{
Cyg_StdioStream *real_stream = (Cyg_StdioStream *)stream;
@@ -267,9 +262,9 @@ externC FILE *fdopen( int fd, const char
fpos_t pos = 0;
real_stream->set_position( pos, SEEK_CUR );
return f;
}
-#endif // def CYGPKG_LIBC_STDIO_FILEIO
+#endif // def CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS
// EOF fopen.cxx