summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorbde <bde@FreeBSD.org>1997-04-13 15:50:07 +0000
committerbde <bde@FreeBSD.org>1997-04-13 15:50:07 +0000
commit3db3e02ae705c5cab18045e8ec5ce26fdea862aa (patch)
treeaa8942224930581fa0a676623e369d5bed5ddba9 /include
parent1c9db9a173eb2859df457050c43bc491c1e7c955 (diff)
downloadFreeBSD-src-3db3e02ae705c5cab18045e8ec5ce26fdea862aa.zip
FreeBSD-src-3db3e02ae705c5cab18045e8ec5ce26fdea862aa.tar.gz
Removed nonstandard #include of <sys/types.h>.
Use _BSD_OFF_T_ instead of off_t so that we're still self-sufficent. Copied the ftruncate/lseek()/mmap()/truncate() redeclaration hacks from <sys/types.h> so that things depending on them don't break.
Diffstat (limited to 'include')
-rw-r--r--include/stdio.h37
1 files changed, 29 insertions, 8 deletions
diff --git a/include/stdio.h b/include/stdio.h
index 9cd10bb..9676379 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 <sys/types.h>
-#endif
-
#include <sys/cdefs.h>
-
#include <machine/ansi.h>
+
#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];
@@ -282,6 +278,30 @@ __END_DECLS
#endif /* not ANSI */
/*
+ * Portability hacks. See <sys/types.h>.
+ */
+#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.
*/
#if !defined (_ANSI_SOURCE) && !defined(_POSIX_SOURCE)
@@ -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_ */
OpenPOWER on IntegriCloud