diff options
author | Danny Smith <dannysmith@users.sourceforge.net> | 2003-09-24 12:26:23 +0400 |
---|---|---|
committer | Danny Smith <dannysmith@users.sourceforge.net> | 2003-09-24 12:26:23 +0400 |
commit | fd4b566a1654b10df6afc068140a659af17c3a76 (patch) | |
tree | d8db6799beaf3e291d13c9e630db1dd597c7addf /winsup/mingw | |
parent | d7717303367bacef3dcf6b9b78f8b468e5f6a3b2 (diff) |
* include/io.h (_fileno): Remove prototype.
(fileno): Likewise.
(FILENAME_MAX): Define, if needed.
Don't include <stdio.h>.
* include/stdio.h (FILENAME_MAX): Protect against
prior definition.
(_fileno): Define macro implementation.
(fileno): Likewise.
Diffstat (limited to 'winsup/mingw')
-rw-r--r-- | winsup/mingw/ChangeLog | 11 | ||||
-rw-r--r-- | winsup/mingw/include/io.h | 14 | ||||
-rw-r--r-- | winsup/mingw/include/stdio.h | 11 |
3 files changed, 28 insertions, 8 deletions
diff --git a/winsup/mingw/ChangeLog b/winsup/mingw/ChangeLog index c7ab2ffd6..426f3e862 100644 --- a/winsup/mingw/ChangeLog +++ b/winsup/mingw/ChangeLog @@ -1,5 +1,16 @@ 2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> + * include/io.h (_fileno): Remove prototype. + (fileno): Likewise. + (FILENAME_MAX): Define, if needed. + Don't include <stdio.h>. + * include/stdio.h (FILENAME_MAX): Protect against + prior definition. + (_fileno): Define macro implementation. + (fileno): Likewise. + +2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> + * include/inttypes.h: Include _mingw.h. 2003-09-24 Danny Smith <dannysmith@users.sourceforge.net> diff --git a/winsup/mingw/include/io.h b/winsup/mingw/include/io.h index c2a257b33..50b395ac5 100644 --- a/winsup/mingw/include/io.h +++ b/winsup/mingw/include/io.h @@ -32,9 +32,6 @@ /* All the headers include this file. */ #include <_mingw.h> -/* We need the definition of FILE anyway... */ -#include <stdio.h> - /* MSVC's io.h contains the stuff from dir.h, so I will too. * NOTE: This also defines off_t, the file offset type, through * an inclusion of sys/types.h */ @@ -62,6 +59,15 @@ typedef unsigned long _fsize_t; #endif /* + * The maximum length of a file name. You should use GetVolumeInformation + * instead of this constant. But hey, this works. + * Also defined in stdio.h. + */ +#ifndef FILENAME_MAX +#define FILENAME_MAX (260) +#endif + +/* * The following structure is filled in by _findfirst or _findnext when * they succeed in finding a match. */ @@ -188,7 +194,6 @@ _CRTIMP int __cdecl _creat (const char*, int); _CRTIMP int __cdecl _dup (int); _CRTIMP int __cdecl _dup2 (int, int); _CRTIMP long __cdecl _filelength (int); -_CRTIMP int __cdecl _fileno (FILE*); _CRTIMP long __cdecl _get_osfhandle (int); _CRTIMP int __cdecl _isatty (int); @@ -258,7 +263,6 @@ _CRTIMP int __cdecl dup (int); _CRTIMP int __cdecl dup2 (int, int); _CRTIMP int __cdecl eof (int); _CRTIMP long __cdecl filelength (int); -_CRTIMP int __cdecl fileno (FILE*); _CRTIMP int __cdecl isatty (int); _CRTIMP long __cdecl lseek (int, long, int); _CRTIMP int __cdecl open (const char*, int, ...); diff --git a/winsup/mingw/include/stdio.h b/winsup/mingw/include/stdio.h index 6ad334ef3..c80b105a2 100644 --- a/winsup/mingw/include/stdio.h +++ b/winsup/mingw/include/stdio.h @@ -65,11 +65,11 @@ /* * The maximum length of a file name. You should use GetVolumeInformation * instead of this constant. But hey, this works. - * - * NOTE: This is used in the structure _finddata_t (see io.h) so changing it - * is probably not a good idea. + * Also defined in io.h. */ +#ifndef FILENAME_MAX #define FILENAME_MAX (260) +#endif /* * The maximum number of files that may be open at once. I have set this to @@ -336,11 +336,16 @@ _CRTIMP int __cdecl _getmaxstdio(void); _CRTIMP int __cdecl _setmaxstdio(int); #endif +#define _fileno(__F) ((__F)->_file) + #ifndef _NO_OLDNAMES _CRTIMP int __cdecl fgetchar (void); _CRTIMP int __cdecl fputchar (int); _CRTIMP FILE* __cdecl fdopen (int, const char*); _CRTIMP int __cdecl fileno (FILE*); + +#define fileno(__F) ((__F)->_file) + #endif /* Not _NO_OLDNAMES */ #endif /* Not __STRICT_ANSI__ */ |