From 15aa51b01cfad3bc8fcb2fd10ad70f32eae0fca5 Mon Sep 17 00:00:00 2001 From: Bruce Evans Date: Sun, 13 Apr 1997 15:50:07 +0000 Subject: [PATCH] Removed nonstandard #include of . Use _BSD_OFF_T_ instead of off_t so that we're still self-sufficent. Copied the ftruncate/lseek()/mmap()/truncate() redeclaration hacks from so that things depending on them don't break. --- include/stdio.h | 37 +++++++++++++++++++++++++++++-------- 1 file changed, 29 insertions(+), 8 deletions(-) diff --git a/include/stdio.h b/include/stdio.h index 9cd10bb6d660..96763790dc57 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -34,19 +34,15 @@ * SUCH DAMAGE. * * @(#)stdio.h 8.5 (Berkeley) 4/29/95 - * $Id: stdio.h,v 1.11 1997/03/02 13:41:23 ache Exp $ + * $Id: stdio.h,v 1.12 1997/03/11 11:16:27 peter Exp $ */ #ifndef _STDIO_H_ #define _STDIO_H_ -#if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__) -#include -#endif - #include - #include + #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ @@ -68,7 +64,7 @@ typedef _BSD_SIZE_T_ size_t; * boundaries. THIS IS A CROCK, but for now there is no way around it. */ #if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__) -typedef off_t fpos_t; +typedef _BSD_OFF_T_ fpos_t; #else typedef struct __sfpos { char _pos[8]; @@ -281,6 +277,30 @@ int fileno __P((FILE *)); __END_DECLS #endif /* not ANSI */ +/* + * Portability hacks. See . + */ +#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE) +__BEGIN_DECLS +#ifndef _FTRUNCATE_DECLARED +#define _FTRUNCATE_DECLARED +int ftruncate __P((int, _BSD_OFF_T_)); +#endif +#ifndef _LSEEK_DECLARED +#define _LSEEK_DECLARED +_BSD_OFF_T_ lseek __P((int, _BSD_OFF_T_, int)); +#endif +#ifndef _MMAP_DECLARED +#define _MMAP_DECLARED +char *mmap __P((char *, size_t, int, int, int, _BSD_OFF_T_)); +#endif +#ifndef _TRUNCATE_DECLARED +#define _TRUNCATE_DECLARED +int truncate __P((const char *, _BSD_OFF_T_)); +#endif +__END_DECLS +#endif /* !_ANSI_SOURCE && !_POSIX_SOURCE */ + /* * Routines that are purely local. */ @@ -379,4 +399,5 @@ static __inline int __sputc(int _c, FILE *_p) { #define getchar() getc(stdin) #define putchar(x) putc(x, stdout) -#endif /* _STDIO_H_ */ + +#endif /* !_STDIO_H_ */