changeset 1774:80c638069a65

* cdl/stdio.cdl: 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.
author jlarmour
date Mon, 27 Sep 2004 11:33:03 +0000
parents 4643fc05d753
children 9d22942e382a
files packages/language/c/libc/stdio/current/ChangeLog packages/language/c/libc/stdio/current/cdl/stdio.cdl packages/language/c/libc/stdio/current/src/common/fclose.cxx packages/language/c/libc/stdio/current/src/common/fopen.cxx
diffstat 4 files changed, 10 insertions(+), 14 deletions(-) [+]
line wrap: on
line diff
--- a/packages/language/c/libc/stdio/current/ChangeLog
+++ b/packages/language/c/libc/stdio/current/ChangeLog
@@ -2,6 +2,12 @@ 2004-09-27  Jonathan Larmour  <jifl@eCos
 
 	* 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>
 
--- a/packages/language/c/libc/stdio/current/cdl/stdio.cdl
+++ b/packages/language/c/libc/stdio/current/cdl/stdio.cdl
@@ -98,8 +98,7 @@ cdl_package CYGPKG_LIBC_STDIO {
     # 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      \
@@ -278,6 +277,7 @@ cdl_package CYGPKG_LIBC_STDIO {
         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
--- a/packages/language/c/libc/stdio/current/src/common/fclose.cxx
+++ b/packages/language/c/libc/stdio/current/src/common/fclose.cxx
@@ -56,9 +56,6 @@
 #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
@@ -131,6 +128,4 @@ fclose( FILE *stream ) __THROW
 
 } // fclose()
         
-#endif // if defined(CYGPKG_LIBC_STDIO_OPEN)
-
 // EOF fclose.cxx
--- a/packages/language/c/libc/stdio/current/src/common/fopen.cxx
+++ b/packages/language/c/libc/stdio/current/src/common/fopen.cxx
@@ -56,9 +56,6 @@
 #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
@@ -234,9 +231,7 @@ fopen( const char *filename, const char 
 } // 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
 {
@@ -269,7 +264,7 @@ externC FILE *fdopen( int fd, const char
     return f;
 }
 
-#endif // def CYGPKG_LIBC_STDIO_FILEIO
+#endif // def CYGFUN_LIBC_STDIO_OPEN_POSIX_FDFUNCS
 
 
 // EOF fopen.cxx