diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 2000-02-22 17:29:15 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 2000-02-22 17:29:15 +0000 |
commit | fd2152f9e652fb5e938bc8f02fac662062af5df2 (patch) | |
tree | 284884ee2de5ccea2086d64cb22b6536e745fdb9 /include/stdio.h | |
parent | 8ddf0fc0955bdedd8f4fdff69c51e32bde9bef12 (diff) |
Use an _BSD_FOO_T_ type declaration for off_t in machine/ansi.h to allow
off_t to be visible in stdio.h even in strict ansi mode. This is needed
for ftello()/fseeko() and it allows us to remove the horrible fpos_t hack.
Diffstat (limited to 'include/stdio.h')
-rw-r--r-- | include/stdio.h | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/include/stdio.h b/include/stdio.h index a423df04159..e0508031ce5 100644 --- a/include/stdio.h +++ b/include/stdio.h @@ -1,4 +1,4 @@ -/* $OpenBSD: stdio.h,v 1.12 2000/02/21 22:11:20 millert Exp $ */ +/* $OpenBSD: stdio.h,v 1.13 2000/02/22 17:29:12 millert Exp $ */ /* $NetBSD: stdio.h,v 1.18 1996/04/25 18:29:21 jtc Exp $ */ /*- @@ -47,13 +47,18 @@ #endif #include <sys/cdefs.h> - #include <machine/ansi.h> + #ifdef _BSD_SIZE_T_ typedef _BSD_SIZE_T_ size_t; #undef _BSD_SIZE_T_ #endif +#ifdef _BSD_OFF_T_ +typedef _BSD_OFF_T_ off_t; +#undef _BSD_OFF_T_ +#endif + #ifndef NULL #ifdef __GNUG__ #define NULL __null @@ -62,22 +67,10 @@ typedef _BSD_SIZE_T_ size_t; #endif #endif -/* - * This is fairly grotesque, but pure ANSI code must not inspect the - * innards of an fpos_t anyway. The library internally uses off_t, - * which we assume is exactly as big as eight chars. - */ -#if !defined(_ANSI_SOURCE) && !defined(__STRICT_ANSI__) -typedef off_t fpos_t; -#else -typedef struct __sfpos { - /* LONGLONG */ - long long _pos; /* XXX must be the same as off_t */ -} fpos_t; -#endif - #define _FSTDIO /* Define for new stdio with functions. */ +typedef off_t fpos_t; /* stdio file position type */ + /* * NB: to fit things in six character monocase externals, the stdio * code uses the prefix `__s' for stdio objects, typically followed |